试图添加’class’html属性,但我认为关键字’class’会导致问题.
<%: Html.TextBox("name","value",new {class: " required "})%>
有解决方法吗?
解决方法
只需在’class’前加上’@’,因为它是
reserved keyword.
<%: Html.TextBox("name",new { @class: " required "})%>
如果你需要@关键字的一些背景知识,this是一个很好的SO问题.
试图添加’class’html属性,但我认为关键字’class’会导致问题. %: Html.TextBox(name, value, new {class: required })% 有解决方法吗? 只需在’class’前加上’@’,因为它是 reserved keyword. %: Html.TextBox(name, value, new { @class:
试图添加’class’html属性,但我认为关键字’class’会导致问题.
<%: Html.TextBox("name","value",new {class: " required "})%>
有解决方法吗?
只需在’class’前加上’@’,因为它是
reserved keyword.
<%: Html.TextBox("name",new { @class: " required "})%>
如果你需要@关键字的一些背景知识,this是一个很好的SO问题.