Question

I am developing a website(web forms , not MVC) in VS 2008(with SP1 ).I am trying to incorporate the ASP.NET Routing.I am following the MSDN tutorial to do it. http://msdn.microsoft.com/en-us/library/cc668201.aspx I have added the below items to my glbal.asax.cs file as per the tutorial

 protected void Application_Start(object sender, EventArgs e)
 {
        RegisterRoutes(RouteTable.Routes);

 }   

 public static void RegisterRoutes(RouteCollection routes)
 {

        routes.Add(new Route
        (
             "Category/{action}/{categoryName}"
             , new CategoryRouteHandler()
        ));
  }

When trying to build it is telling like "The type or namespace name 'RouteCollection' could not be found (are you missing a using directive or an assembly reference?)

I have System.web imported to my global.asax file

Any Idea how to get rid of it ?

Was it helpful?

Solution

You need to import System.Web.Routing as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top