ASP.NET MVC 伪静态的实现
2020-12-13 14:47
标签:style class blog code color get 最后记得Web.config配置: 这个配置了之后就意味着html都走应用程序管道了,不知道怎么处理? ASP.NET MVC 伪静态的实现,搜素材,soscw.com ASP.NET MVC 伪静态的实现 标签:style class blog code color get 原文地址:http://www.cnblogs.com/yxlblogs/p/3795045.htmlpublic class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("Category",
"list/{filterAttr}-{cateId}-{brandId}-{sortColumn}-{page}.html",
new { controller = "Home", action = "Index", id = UrlParameter.Optional });
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
public class SearchModel
{
public int BrandId { set; get; }
public int FilterAttr { get; set; }
public int CateId { get; set; }
public int SortColumn { get; set; }
public int Page { get; set; }
}
public ActionResult Index( SearchModel model )
{
return View(model);
}
@{
ViewBag.Title = "Index";
}
@model MvcApplication3.Models.SearchModel
h2>Indexh2>
@Html.RouteLink("aa","Category")
FilterAttr:@Model.FilterAttrbr />
CateId:@Model.CateIdbr />
BrandId:@Model.BrandIdbr />
SortColumn:@Model.SortColumnbr />
Page:@Model.Pagebr />
system.webServer>
上一篇:Java虚拟机
下一篇:算法第二章上机实践报告
文章标题:ASP.NET MVC 伪静态的实现
文章链接:http://soscw.com/index.php/essay/34477.html