我正在尝试使用 Spark 和 MVC 呈现纯 html 视图,但出现以下错误:
The view 'Principal.html' or its master could not be found. The following locations were searched:
~/Views/Site/Principal.html.aspx
~/Views/Site/Principal.html.ascx
~/Views/Shared/Principal.html.aspx
~/Views/Shared/Principal.html.ascx
Site\Principal.html.spark
Shared\Principal.html.spark
在我的控制器中,我有:
public ViewResult Principal()
{
return View("Principal.html");
}
我在我的 Global.asax, Start 方法中注册了 spark engina
protected override void Start()
{
...
RegisterViewEngine(ViewEngines.Engines, RouteTable.Routes);
RegisterRoutes(RouteTable.Routes);
}
private void RegisterViewEngine(ViewEngineCollection engines, RouteCollection routes)
{
SparkViewFactory engine = new SparkViewFactory();
RegisterFactory.DefaultRegister(IoCService.MyContainer, engine, routes);
engines.Add(engine);
}
如何指示要呈现的页面是 html (Principal.html) 而不是 spark 扩展?
提前致谢!