我刚学 mvc,现在要 匹配一个url规则,
//默认
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
要求:匹配一个 以 .html 或.htm 结尾的url规则,
请大家帮帮忙,谢谢啦!
//默认
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
要求:匹配一个 以 .html 或.htm 结尾的url规则,
请大家帮帮忙,谢谢啦!
routes.MapRoute(
"Default",
"{controller}/{action}/{page}",
new { controller = "Home", action = "Index", page = "index.htm" },
new { page=@".*\.[htm|hml]"});
"Default",
"{controller}/{action}/{page}",
new {chinese wholesalers
ugg= "Home", action = "Index", page = "index.htm" },
new { page=@".*\.[htm|hml]"});