In the last post I talked about creating a custom ActionResult, the next question is, what if I want to add my a custom view engine? As an example lets say your company’s intranet uses multiple platforms (php, java, and now asp.net mvc) and to keep the look and feel constant you use xslt to render your header and footer, a simple solution is to add a xslt View Engine to generate the markup.
First you create a view to parse and output for content
then you create a view engine by inheriting from VirtualPathProviderViewEngine and override the CreatePartialView and CreateView methods to call your view
to add the view open global.ascx.cs and modify the application start method to add the new view engine
now to use it just add you xslt file to your view folder like you would with any other view and return your serializable object to the the View you’re returning
for the full source (click here)