Binding more than one <select> in ASP.NET MVC? -
I have a table of items, each of my own & lt; Select & gt;
How do I bind them in the parameters of a controller method?
Ideally, I have an array containing (for each row in the table) value
code> options .
How do I do this? My google-fu is weak today
all your And your post action may look like this: & lt; Select & gt; The same name should be plus [N] in S, where n is zero based. Try it out:
& lt;% var i = 0; & Gt%; & Lt;% foreach (Miscellaneous Rows in Model. Rye) {%> & Lt; TR & gt; & Lt; TD & gt; & Lt;% = Html.DropDownList (string.format ("option [{0})", i ++), line.Ennormable in specified form & lt; SelectListItem>)% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt;%}% & gt;
public action your action (string [] option) {...}
Comments
Post a Comment