asp.net mvc - unable to pass parameter value inside Html.EditableGridView in mvc cshtml -
In the MVC 4 project I tried to do the pass parameter value
, but I Unsuccessful syntax
. .cshtml file in
@ (Html.EditableGridView & lt; MyModel> ("TestGridView", model, Server.MapPath ("~ / XmlFile / Test .xml "), GridRowSelectionMode.Multiple, New {cssObj =" genericContentCss ", url =" / Test / GetMyPartial? Mode = Edit and ID = "}))
< I want to pass the ID parameter value such as id =@Model.Id
in the URL> but it does not work, I miss something very little I tried Google but failed to do this
How about:
< Code> @ html.EditableGridView & lt; MyModel & gt; ("TestGridView", Model, Server.MapPath ("~ / XmlFile / Test.xml"), GridRowSelectionMode.Multiple, New {cssObj = "genericContentCss", url = "/ Test / GetMyPartial? Mode = Edit & amp; id =" + Model.Id})
Or you can use the url Action ()
:
url = Url.Action ("GetMyPartial", "Test", new {mode = "Edit", id = Model.Id})
In the above code:
@ Html.EditableGridView & lt; MyModel & gt; ("TestGridView", Model, Server.MapPath ("~ / XmlFile / Test.xml"), GridRowSelectionMode.Multiple, New {cssObj = "genericContentCss", url = Url.Action ("GetMyPartial", "Test", New { Mode = "Edit", id = Model.Id})})
Comments
Post a Comment