1
具有以下.cshtml:警告在剃刀时<img width="@someVar">
@{ int someVar = 300; }
<img width="@someVar">
的Visual Studio(2012)给了我一个警告:
Warning 1 '@width' is not a valid value of attribute 'width'.
它的工作好,但我不知道是否有任何将变量传递给width属性的方法,而不会有此警告。
谢谢!
不起作用:警告'@(someVar)'不是属性'width'的有效值。 –