MVC 伪静态的实现方式
来源:互联网 发布:监控软件 linux 排行 编辑:程序博客网 时间:2024/05/21 07:14
http://blog.csdn.net/sqqyq/article/details/7970007
修改Global.asax:
如果有更好更简洁高效完善的方式,欢迎指导。
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"DefaultHtml", // controller伪静态
"{controller}.html/{action}/{id}",// 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"DefaultHtml2", // action伪静态
"{controller}/{action}.html/{id}",// 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"DefaultHtml3", // id伪静态
"{controller}/{action}/{id}.html",// 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"Default", // 路由名称
"{controller}/{action}/{id}", // 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
}
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"DefaultHtml", // controller伪静态
"{controller}.html/{action}/{id}",// 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"DefaultHtml2", // action伪静态
"{controller}/{action}.html/{id}",// 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"DefaultHtml3", // id伪静态
"{controller}/{action}/{id}.html",// 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
routes.MapRoute(
"Default", // 路由名称
"{controller}/{action}/{id}", // 带有参数的 URL
new { controller="Home", action="Index", id= UrlParameter.Optional }// 参数默认值
);
}
0 0
- MVC 伪静态的实现方式
- MVC 伪静态的实现方式
- MVC实现伪静态
- PHP实现伪静态化页面的具体实现方式
- PHP实现伪静态化页面的具体实现方式
- 伪静态的实现
- 伪静态的实现
- 伪静态的实现
- 实现PHP伪静态的方式之URL重写
- Mvc实现伪静态 (.html)
- ef+mvc实现删除与伪静态
- PHP伪静态4种实现方式
- PHP伪静态的实现
- 伪静态的实现方法
- 伪静态如何实现的
- 伪静态如何实现的
- 伪静态的实现方法
- MVC 伪静态配置
- openstack命令备忘录
- 如何测试静音检测
- 位运算的一些用途
- hdu 1498 50 years, 50 colors
- 国家统计局:去年领导干部在家时间平均增30分钟
- MVC 伪静态的实现方式
- cmd中操作命令
- 初学C++之通用工具(一)
- 2>.设两个二维数组,分别用两种方式进行初始化,并分别按照行优先(先输出第一行所有值,再输出第二行)、列优先(先输出第一列的所有值,再输出第二列)的次序输出。
- LinkedHashMap和HashMap的区别以及使用方法
- proc/sys/net/ipv4/下各项的意义
- 第4周作业-打字成绩判断程序—修改
- C++贪吃蛇实例化
- vivado学习实验4笔记