zl程序教程

您现在的位置是:首页 >  其它

当前栏目

How To Display Variable Value In View?

to in View value How variable display
2023-09-11 14:14:18 时间

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