标签:
在设置页面静态化的路由,代码如
//静态路由 routes.MapRoute( name: "html", url: "{controller}/{action}.html", defaults: new { controller = "Main" , action = "Index" } );
< handlers> < add name = "html_64.bit" path = ".html" verb = "*" type ="C:\windows\Microsoft .NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType = "Unspecified" preCondition ="integratedMode" /> < add name = "html_32.bit" path = "*.html" verb = "*" type ="C:\windows\Microsoft .NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType = "Unspecified" preCondition ="integratedMode" /> </ handlers >
这样子所有的Action请求就可以加上.html后缀了,
< handlers > < add name = "text" path = "text.html" verb = "*" modules ="StaticFileModule" resourceType ="File" /> </ handlers >
标签:
原文地址:http://www.cnblogs.com/simoncai/p/5140773.html