无知并不恐怖,只要舍得力气去尝试就会变有知

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

原来是这样插入代码的,哈哈,我以前老见别人笔记中的代码可以折叠、保持原样、并且有灰色背景,一直搞不明白,
因为我太懒了,一尝试就会了。

posted @ 2009-09-03 11:19  翔宇编程  阅读(212)  评论(0编辑  收藏  举报
51CTO