Your viewer should implement the IViewEngine interface. After registering your viewer with the ViewEngines.Engines.Add() method, the MVC structure will call FindView and FindPartialView whenever it needs a viewer to render the view.
It is possible for several viewing mechanisms to work side by side. If you do not want your view mechanism to be used in a specific situation, you return new ViewEngineResult(new string[0]); from FindView or FindPartialView , and MVC will choose a different viewing engine. If you want your view mechanism to be used, you return a valid ViewEngineResult indicating the view class (which implements IView ) that you want to render .
There are some features with the useCache parameter. If you want to know more, there was a wonderful presentation about creating your own viewing engine in TechEd 2011 from Louis DeJardin. You can find the Video Writing ASP.NET MVC View Engine in Channel9.
source share