惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
Recent Announcements
Recent Announcements
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
博客园_首页
The Cloudflare Blog
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题
P
Proofpoint News Feed
Y
Y Combinator Blog
Jina AI
Jina AI
博客园 - 聂微东
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
F
Full Disclosure
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
J
Java Code Geeks
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
宝玉的分享
宝玉的分享
IT之家
IT之家
Hacker News: Ask HN
Hacker News: Ask HN
The Register - Security
The Register - Security
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs

博客园 - Ferry

ASP.NET网站权限设计实现(三)——套用JQuery EasyUI列表显示数据、分页、查询 ASP.NET网站权限设计实现(二)——角色权限绑定 ASP.NET读取网络图片并在页面上显示 ASP.NET网站权限设计实现(一)——使用PowerDesigner进行数据库设计 Visual Studio 2010 架构图之用例图(UML Use Case Diagram) 一个德国人图解中西文化差异(值得一看) 微软AJAX CDN(内容分发网络) 注册使用GAC—Global Assembly Cache(.NET) ASP.NET 递归将分类绑定到 TreeView - Ferry 新浪微博PC客户端(DotNet WinForm版)——功能实现分解介绍 新浪微博PC客户端(DotNet WinForm版)—— 初探 C#:30行数据插入到数据库中的效率测试-一行行执行、构造SQL一次执行、SqlBulkCopy C#使用GMAIL群发带附件邮件的例子 ASP.NET Web 应用开发实战快速上手系列 3—C#面向对象编程纲要-类 ASP.NET带进度条多文件上传 ASP.NET4.0中客户端ID的生成 在高优先级下运行应用程序 学习使用NHibernate2.1.0Beta1(续七)— 单例模式 ASP.NET Web 应用开发实战快速上手系列 2——C#基础
ASP.NET MVC3 新的视图引擎(View Engine)
Ferry · 2011-01-09 · via 博客园 - Ferry

直到ASP.NET MVC2,微软为开发者提供的视图模板依然是传统的.aspx/.ascx/.master。

 


从ASP.NET MVC3开始,开发者将有更多的选择,视图模板包括:ASPX、RAZORNHAMLSPARK。 


 ASP.NET MVC3之前,开发者写代码块是这个样子:

 

 使用的是<%=%>块

而如果使用Rator视图引擎,用一个@字母即可

 

循环情况代码对比:

 

 

看一下Spark视图引擎的代码:

<viewdata products="IEnumerable[[Product]]"/>
<ul if="products.Any()">
  
<li each="var p in products">${p.Name}</li>
</ul>
<else>
  
<p>No products available</p>
</else>

更多资料,访问ScottGu's Blog: