asp.net mvc 设置启动页面在区域中
2016-07-02 16:12
537 查看
在开发过程中,我们有时候需要启动区域中的页面为起始页面,那我们就需要子啊路由中添加一段代码
如何完整案例:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Personnal", action = "Index", id = UrlParameter.Optional }
).DataTokens.Add("Area", "PseronnalMenanger");
}
如何完整案例:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Personnal", action = "Index", id = UrlParameter.Optional }
).DataTokens.Add("Area", "PseronnalMenanger");
}
相关文章推荐
- ireport、jasperreport报错信息
- yo aspnet
- Asp.Net MVC 扩展 Html.ImageFor 方法详解
- ASP.NET Core 介绍
- VS Code开发调试ASP.NET Core 1.0
- Asp.Net Core
- .NET Core & ASP.NET Core 1.0
- 在eclipse中使用Aspectj
- 使用Aspect来对访问方法进行预处理和后处理
- [转]ASP.NET MVC Dynamic Themes
- AnnotationAwareAspectJAutoProxyCreator is only available on Java 1.5 and higher
- aspx文件的构成
- 七天学会ASP.NET MVC (五)——Layout页面使用和用户角色管理
- 构建高性能ASP.NET站点 第五章—性能调优综述(后篇)
- 构建高性能ASP.NET站点 第五章—性能调优综述(中篇)
- ASP.NET MVC 教程学习
- 构建高性能ASP.NET站点之一 剖析页面的处理过程(前端)
- 2014年基于Raspberry Pi的5大项目
- 2014年基于Raspberry Pi的5大项目
- 聊聊asp.net中Web Api的使用