using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using System.Web.Routing;
namespace MVCDemo{ // Note: For instructions on enabling IIS6 or IIS7 classic mode, // visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults );
}
protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } }}
Code 1using System; 2using System.Collections.Generic; 3using System.Linq; 4using System.Web; 5using System.Web.Mvc; 6using System.Web.Routing; 7 8namespace MVCDemo 9{10 // Note: For instructions on enabling IIS6 or IIS7 classic mode, 11 // visit http://go.microsoft.com/?LinkId=93948011213 public class MvcApplication : System.Web.HttpApplication14 {15 public static void RegisterRoutes(RouteCollection routes)16 {17 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");1819 routes.MapRoute(20 "Default", // Route name21 "{controller}/{action}/{id}", // URL with parameters22 new { controller = "Home", action = "Index", id = "" } // Parameter defaults23 );2425 }2627 protected void Application_Start()28 {29 RegisterRoutes(RouteTable.Routes);30 }31 }32}原来是这样插入代码的,哈哈,我以前老见别人笔记中的代码可以折叠、保持原样、并且有灰色背景,一直搞不明白,因为我太懒了,一尝试就会了。
转载于:https://www.cnblogs.com/Fly-sky/archive/2009/09/03/1559393.html
相关资源:数据结构—成绩单生成器