Does anyone know if it's possible to check if a partial view exists from within an HtmlHelperExtension?
I know it's possible from a controller using the following:
private bool ViewExists(string name)
{
ViewEngineResult result = ViewEngines.Engines.FindView(ControllerContext, name, null);
return (result.View != null);
}
Source: Does a View Exist in Asp.Net MVC?
But you can't do the above in a helper, as you don't have access to the controller context. Any thoughts on how to do this?