The MVC framework – customizing the search locations

Published Fri, Sep 19 2008 12:45

In the last post, we’ve seen what view engines do and how the WebFormViewEngine is responsible for initiating the properties that specify the places where the views (ASP.NET pages and user controls) are supposed to be located. At the time, I mentioned how you could register your own engine, but I forgot to point that you can easilly use that info to customize the place where your views are searched. So, if you don’t like the current restrictions but you do want to use ASP.NET pages and user controls, you can always inherit from the VirtualPathProviderViewEngine and build the array with the new locations from within the constructor of your new class.

Another thing I didn’t mention was that the VirtualPathProviderViewEngine uses caching for saving path info. This means that after finding the path to a view, it will add it to the cache and in future requests it will just return the path that exists there. In future versions you should be seing a plugable cache provider in the API of the class (meaning that you will be able to pass your own custom cache instances).

Ok, now we’re ready to keep going and the next post will be about the WebFormView class. Keep tuned!

Filed under: ,

Comments

# ASP.NET MVC Archived Blog Posts, Page 1 said on Friday, September 19, 2008 8:34 AM

Pingback from  ASP.NET MVC Archived Blog Posts, Page 1

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above:  

Search

This Blog

Tags

Community

Archives

Syndication

Email Notifications

News




  • View Luis Abreu's profile on LinkedIn


    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover