天天看点

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";