开发者

How to write Dynamic c# code when views not inherited by browser in Razor MVC 3

i want to know how i can use Dynamic c# whenever i not inherited my views by model.

are their any way to write dynamic c# in views whenever i use Razor.

like how i can write razor code who match this aspx cod

<% List<item> items = new List<ite开发者_如何学编程m>(); %>

how i can write this in my MVC 3 application views [razor]


@{
    List<item> items = new List<item>();
}

Scott Gu has a full coverage about razor syntax.


Basic rule of thumb:

<%= %> becomes @( )

and

<% %> becomes @{ }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜