public class MvcApplication : System.Web.HttpApplication {
        public static void RegisterRoutes(RouteCollection routes) {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");            routes.MapRoute(
                "Default",                                              // Route name
                "{controller}.aspx/{action}/{id}",                           // URL with parameters
                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );  
            // 原先是{controller}/{action}/{id} 给加了个后缀之后
      // 之前的Default.aspx(默认的起始页)运行时就会报“传入的请求不与任何路由匹配。”
      // 因为是在iis6下发布的 所以要加个后缀
      // 也刚学这个不知道为什么会出现这问题 请问谁能帮忙看下?
        }        protected void Application_Start() {
            RegisterRoutes(RouteTable.Routes);
        }
    }// 这是Default.aspx.cs里边默认的代码
        public void Page_Load(object sender, System.EventArgs e) {
            // Change the current path so that the Routing handler can correctly interpret
            // the request, then restore the original path so that the OutputCache module
            // can correctly process the response (if caching is enabled).            string originalPath = Request.Path;
            HttpContext.Current.RewritePath(Request.ApplicationPath, false);
            IHttpHandler httpHandler = new MvcHttpHandler();
            httpHandler.ProcessRequest(HttpContext.Current);
            HttpContext.Current.RewritePath(originalPath, false);
        }