ASP.NET MVC 3: Override “name” attribute with TextBoxFor

前端 未结 11 1509
臣服心动
臣服心动 2020-11-28 05:41

Is it possible when using Html.TextBoxFor to override the name attribute?

I have tried with no success. I need to use TextBoxFor to get client side vali

11条回答
  •  失恋的感觉
    2020-11-28 06:08

    It is call Microsoft GOTCHA

    Use the name in caps, like this

    @Html.TextBoxFor(m => m.Reply.Answer, new {@Name="Whatyouwant"})
    

提交回复
热议问题