UpdateModel prefix - ASP.NET MVC

后端 未结 4 1224
悲哀的现实
悲哀的现实 2020-12-29 12:23

I\'m having trouble with TryUpdateModel(). My form fields are named with a prefix but I am using - as my separator and not the default dot.

<         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 12:57

    that was bad decision to use period. Underscore would have been better.

    This means you have to separately define all your ids.

    ie. Textbox now has Html.TextBox("test.test", new{@id="test")

提交回复
热议问题