views:

329

answers:

3

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 ?

A: 

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

womp
A: 

Oh ! I forgot to Add the assembly System.Web.Routing to the project.ITs working now

Shyju
A: 

Is working? And what about the "new CategoryRouteHandler()"? It seems not to be recognized...

Jortx