Name of dropdowlist is renamed automatically????
- by Akawan
Hello,
I've a problem with DropDownlist Name in ASP.NET MVC
In my EditorTemplate, I've
<%: Html.DropDownList("PoolGeometry",Model.selectVm.PoolGeometry, new { id = "poolgeometry" })%>
In generate html, I've
<select name="Pool.PoolGeometry" id="poolgeometry">
Normally, "PoolGeometry" is a field in db. If my dropdownlistname has the same name, selected value is value of field.
I don't understand this automatic rename!
EDIT :
Name is dependent on EditorTemplate :
if EditorTemplate called like this:
<%: Html.EditorFor(model => model.Pool,"SwimmingPool","")%>
Name of dropdownlist is "PoolGeometry" and selectedvalues are ok.
But if it is called like this:
<%: Html.EditorFor(model => model.Pool,"SwimmingPool")%>
Name of dropdownlist is "Pool.PoolGeometry"