简单常用的MVC路由
- routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
-
- routes.MapRoute(
- name: "scholarinfo",
- url: "{controller}/{id}",
- defaults: new { Controller = "scholar", action = "Info" }
- );
- routes.MapRoute(
- name: "controllerdefault",
- url: "{Controller}",
- defaults: new { action = "Index" }
- );
- routes.MapRoute(
- name: "root",
- url: "",
- defaults: new {controller = "scholar", action = "index" }
- );
复制代码
|
|