ASP.NET MVC 4 override emitted html name and id

前端 未结 4 629
渐次进展
渐次进展 2020-12-15 02:46

I\'m trying to change the emitted name of the html input created by @Html.HiddenFor.

The code I\'m using this:

@Html.HiddenFor(e => e         


        
4条回答
  •  自闭症患者
    2020-12-15 03:02

    If you use:

    @Html.HiddenFor(e => e.SomeProperty, new { @id = "some_property", @Name = "some_property" });

    Notice the capital "N" in @Name. It´ll work.

提交回复
热议问题