I am a new user to mvc 3. I read this article to develop mvc module. Now I want to add other controls instead of text box. E.g. when I wish to add details in movie list.
A dropdown for genre should appear
I am a new user to mvc 3. I read this article to develop mvc module. Now I want to add other controls instead of text box. E.g. when I wish to add details in movie list.
A dropdown for genre should appear
ASP.NET MVC isn't quite like WebForms in that there's a set of server controls all ready and waiting for you to "Drag and Drop" them in your page.
In ASP.NET MVC you typically use the HTML elements as controls (often times with HtmlHelper
s). For instance, if you wanted a "dropdown for genre", you'd do something like:
<select>
<option value="genre1">Genre1</option>
<option value="genre2">Genre2</option>
</select>
Or, to generate this with an HtmlHelper
, you'd do something like:
@Html.DropDownListFor(m => m.YourModelProperty, YourSelectList)