using @data-bind in ASP.NET MVC htmlAttributes throws exception

后端 未结 2 1563
别跟我提以往
别跟我提以往 2021-02-19 14:39

I am using ASP.NET MVC 3.0 and KnockoutJS. I was trying to add the binding into my View Helpers like this ...

@Html.TextBoxFor(model => model.Nam         


        
2条回答
  •  被撕碎了的回忆
    2021-02-19 15:19

    It doesn't like the hyphen in the property name. To fix this change @data-bind to @data_bind and this will then render with a hyphen on the page.

提交回复
热议问题