开发者

Name of dropdowlist is renamed automatically?

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="poo开发者_StackOverflow社区lgeometry">

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"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜