ASP.NET路由:缺少RouteCollection类
我正在VS2008(SP1)中开发一个网站(web表单,而不是MVC)。我正在尝试合并ASP.NET路由。我正在按照MSDN教程来做。 根据教程,我已将以下项目添加到我的glbal.asax.cs文件中ASP.NET路由:缺少RouteCollection类,asp.net,routing,Asp.net,Routing,我正在VS2008(SP1)中开发一个网站(web表单,而不是MVC)。我正在尝试合并ASP.NET路由。我正在按照MSDN教程来做。 根据教程,我已将以下项目添加到我的glbal.asax.cs文件中 protected void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } public static void RegisterRout
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()
));
}
当尝试构建时,它会告诉您“找不到类型或命名空间名称'RouteCollection'(是否缺少using指令或程序集引用?)
我已将System.web导入到我的global.asax文件中
知道如何摆脱它吗?您还需要导入System.Web.Routing