Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Routing : RouteCollection class missing

Tags:

asp.net

routes

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 ?

like image 979
Shyju Avatar asked Nov 01 '25 09:11

Shyju


1 Answers

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

like image 70
womp Avatar answered Nov 03 '25 23:11

womp