开发者

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

开发者 https://www.devze.com 2023-02-05 10:05 出处:网络
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.

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

精彩评论

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