调出MVC 5中的剃须刀页面

时间:2019-05-08 21:13:04

标签: javascript asp.net-mvc

现在回到旧的绘图板,因为我是stack,我也是Overflow
我正在MVC5中建立网页
我想在当前页面中显示一个错误
为了做到这一点,我在Routeconfig文件中使用了以下功能:

routes.RouteExistingFiles = True
    routes.MapRoute(
       name:="UHerror",
       url:="{controller}/{action}/{id}",
       defaults:=New With {.controller = "login", .action = "UHPageErrorIndex", .id = UrlParameter.Optional}
   )

然后在我的controller中使用以下功能:

Public Function UHPageErrorIndex() As ActionResult ' JavaScriptResult
        Dim routes As New RouteCollection With {.RouteExistingFiles = True}
        Return View("login", "UsersHandlerIndex")
    End Function

我的View page名为UsersHandlerIndex
在名为Layout page的{​​{1}}中,我使用以下_UsersHandlerLayout

java script

现在有了这种“方法”,我无法回叫<script type="text/javascript"> $(document).ready(function () { var errCall = '@dataEntry.My.Resources.Properties.errorCall.ToString'; var errMess = 'ErrorMessage:= \r\n' + '@dataEntry.My.Resources.Properties.InnerError'; if (errCall == 'True') { window.alert(errMess); } }); </script> 我的refresh页面
我曾在Stack Overflow中查看过其他类似问题,但没有人讨论该问题。 从控制器刷新页面。那就是我要为那些未做的事情做的
有没有人可以协助我?

0 个答案:

没有答案