use viewengine only within certain area
- by Daniel Powell
Is it possible to use a custom view engine for a specific area only?
I have tried
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Forms_default",
"Forms/{client}/{controller}/{action}/{id}",
new { client="Generic",action = "Index", id = UrlParameter.Optional }
);
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new ClientSpecificViewEngine());
}
Within my area but this seems to be a site wide affect as I'm getting errors specific to the custom view engine when visiting pages outside the area.