700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Asp.net MVC razor语法参考

Asp.net MVC razor语法参考

时间:2024-04-25 04:44:23

相关推荐

Asp.net MVC razor语法参考

Razor语法的快捷参考/archive//01/06/razor-syntax-quick-reference.aspx/

只是copy下来便于查阅!

I gave a presentation to another team at Microsoft yesterday on MVC and the Razor view engine and someone asked if there was a reference for the Razor syntax.

It turns out, there is a prettygood guide about Razoravailable, but it’s focused on covering the basics of web programming using Razor and inline pages and not just the Razor syntax.

So I thought it might be handy to write up a a really concise quick reference about the Razor syntax.

Notice in the “mixing expressions and text” example that Razor is smart enough to know that the ending period is a literal text punctuation and not meant to indicate that it’s trying to call a method or property of the expression.

Let me know if there are other examples you think should be placed in this guide. I hope you find this helpful.

UPDATE 12/30/:I’ve added a few new examples to the table of new additions to Razor v2/ MVC 4 syntax. Razor got a lot better in that release!

Also, if you want to know more, consider buying theProgamming MVC 4book. Full disclosure, I'm one of the authors, but the other three authors are way better.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。