view engines

There are 4 entries for the tag view engines

Interesting use of XML Literals as a View Engine

Dmitry, who’s the PUM for ASP.NET, recently wrote a blog post about an interesting approach he took using VB.NET XML Literals as a view engine for ASP.NET MVC. Now before you VB haters dismiss this blog post and leave, bear with me for just a second. Dmitry and I had a conversation one day and he noted that there are a lot of similarities between our view engine hierarchy and and normal class hierarchies. For example, a master page is not unlike a base class. Content placeholders within a master page are similar to abstract methods. Content placeholders...

ASP.NET MVC Northwind Demo Using the Spark View Engine

While at PDC, I met Louis DeJardin and we had some lively discussions on various topics around ASP.NET MVC. He kept bugging me about some view engine called Flint? No… Electricity? No… Spark! I had heard of it, but never got around to actually playing with it until after the conference. And the verdict is, I really like it. Spark is a view engine for both Monorail and ASP.NET MVC. It supports multiple content area layouts much like master pages, which is one thing that seems to be lacking in many other view engines I’ve seen, which only...

Rendering A Single View Using Multiple ViewEngines

One of the relatively obscure features of ASP.NET view rendering is that you can render a single view using multiple view engines. Brad Wilson actually mentioned this in his monster blog post about Partial Rendering and View Engines in ASP.NET MVC, but the implications may have been lost amongst all that information provided. One of the best features of this new system is that your partial views can use a different view engine than your views, and it doesn’t require any coding gymnastics to make it happen. It all comes down to how the new...

Security Tip: Blocking Access to ASP.NET MVC Views Using Alternative View Engines

When you create a new ASP.NET MVC project using our default templates, one of the things you might notice is that there is a web.config file within the Views directory. This file is there specifically to block direct access to a view. Let’s look at the relevant sections. For IIS 6 (and Cassini) <add path="*.aspx" verb="*" type="System.Web.HttpNotFoundHandler"/> For IIS 7 <add name="BlockViewHandler" path="*.aspx" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/> What these sections do is block all access to any file with the .aspx extension...