How it works
How the application of the SharePoint theme is achieved
- A SharePoint Master Page contains all SharePoint styles and theme
- A custom ASP.net page (MVCHostingPage) is based upon the SharePoint Master Page
- MVCHostingPage contains a web control called RenderControl
- RenderControl (and other internal classes) interrogates the current request and forwards it onto the ASP.mvc rendering engine.
The Sleight Of Hand
Then a HttpHandler is registered that points all requests to *.mvc to the MvcHostingPage.aspx
This way a
sleight of hand is achieved. The url looks and acts like a ASP.mvc url but it is pre-processed, and wrapped, by the SharePoint theme.
SharePoint really has nothing to do with it
Now in reality this approach could be used to host ASP.mvc content in any existing ASP.net website. So in theory it could be used as a transition approach for legacy websites.