当前位置: 移动技术网 > IT编程>开发语言>c# > mvc伪静态

mvc伪静态

2019年08月19日  | 移动技术网IT编程  | 我要评论

方法一:iis配置伪静态

 方法二:项目配置伪静态

网站配置文件web.config

<system.webserver>
<handlers>
<add name="html_pagehandlerfactory" path="*.html" verb="*" type="system.web.ui.pagehandlerfactory" resourcetype="unspecified" precondition="integratedmode"/>
</handlers>
</system.webserver>

路由配置页面routeconfig.cs

routes.maproute(
"action1html",  // action伪静态
"{controller}/{action}.html", // 带有参数的 url
new { controller = "home", action = "index", id = urlparameter.optional }// 参数默认值
);

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网