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) selected value code> options .

How do I do this? My google-fu is weak today

all your & 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;  

And your post action may look like this:

  public action your action (string [] option) {...}  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -