如何重新加载MVC页面



这是一个MVC Razor页面,在首次加载上正常工作。如果我在浏览器菜单(Chrome(中使用JavaScript或什至刷新的重新加载,我会得到服务器错误中的"/'应用程序"。

>The view 'actionChangeUserSentence' or its master was not found or no view 
>engine supports the searched locations. The following locations were searched:
>~/Views/Conduct/actionChangeUserSentence.aspx
>~/Views/Conduct/actionChangeUserSentence.ascx
>~/Views/Shared/actionChangeUserSentence.aspx
>~/Views/Shared/actionChangeUserSentence.ascx
>~/Views/Conduct/actionChangeUserSentence.cshtml
>~/Views/Conduct/actionChangeUserSentence.vbhtml
>~/Views/Shared/actionChangeUserSentence.cshtml
>~/Views/Shared/actionChangeUserSentence.vbhtml
> and so on...

表示URL字符串被认为是非MVC URL。我尝试了几种重新加载的可能性,包括:

-location.reload();
-window.location.reload(false); with both false and true
-location.href = location.href;
-history.go(0);

顺便说一句,我需要刷新的原因是,在HTML帆布上绘制JS除了全页(re(加载后不起作用,原因仍然未知。但是无论如何,浏览器菜单刷新当然应该始终工作,我想...感谢您的任何帮助。

我建议将代码放在绘图画布的准备就绪功能上,这可能会帮助您

仅使用Response.Redirect("/<your page>");

最新更新