I am working on MVC4 , using @Html.EditorForModel()
, it is showing dropdownlist
as a text box, I want to show Dropdown
list by setting any attribute
and overriding template. Please share me MVC4 example for this.
@model Models.Employee
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>Employee</legend>
@Html.EditorForModel()
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
Thanks in advance.
See Question&Answers more detail:os