首页 > TAG信息列表 > asp-net-mvc-areas

ASP.net MVC 4是否有一些标准化的方式来引用JavaScript中的相对路径?

我正在开发一个ASP.net MVC应用程序.我真正喜欢ASP.net MVC的一个方面是它允许你引用服务器端代码中的相对路径.我想知道在客户端代码中是否有一些标准化的方法. 我有办法做到这一点.我在布局页面中写了以下内容. <script type="text/javascript"> var ApplicationPath = '@Ur

c# – Asp.net Mvc区域路由问题

我希望网站的默认页面是Login.cshtml.我得到了例外: Error: The view ‘LogIn’ or its master was not found or no view engine supports the searched locations. The following locations were searched: 我有2个区域.结构如下所示. 我的routeconfig如下所示. using System;

c# – ASP.NET MVC路由不起作用

我有2条不同的路线: context.MapRoute( "zyzzyva_default", "{urlTitle}", new { area = "zyzzyva", action = "Index", controller = "Home", urlTitle = UrlParameter.Optional } ); 第二个: context.MapRoute(

c# – 从MVC区域重定向会将我重定向到顶级操作吗?

我有以下项目结构.我在测试区内有两个家庭和帐户控制器,在路线级项目有一个.现在从区域登录后我想重定向区域的主页索引但是它将我重定向到路由级别主页索引. 测试区域注册MapRoute public override void RegisterArea(AreaRegistrationContext context) { c

c# – MVC5区域无法正常工作

我的MVC 5应用程序中有两个区域无法正常工作. 当我使用以下链接http:// localhost:45970 / Admin / Admin时,应用程序加载正确的index.cshtml whicxh位于/Areas/Admin/Views/Admin/Index.cshtml但是当我尝试加载http:/时/ localhost:45970 / Admin它尝试从/Views/Admin/Index.cshtml加