How To Display Variable Value In View?
How To Display Variable Value In View?
There are several ways. For example simply using @
like this:
<td>
@y
</td>
Or by using a <span>
tag like this:
<span>Your Text @(y) ...</span>
Or using Html.Label
helper:
@Html.Label("lblName", y)
可以不加括号的
@{
var str="hello world";
}
使用的时候 @str