asp.net mvc修改默认路由(刚刚运行进入那个页面由你控制)


namespace MvcApplication4
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Default1", action = "Ajax", id = UrlParameter.Optional }
);
}
}
}

修改default:部分即可,如图,跳转到localhost/Default1/Ajax

posted @ 2015-03-24 14:39  ip8888  阅读(358)  评论(0编辑  收藏  举报