本文介绍了如何在ASP.NET中使用routecollection?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好
我想在我的asp.net网站上使用RouteCollection。
我尝试了什么:
Global.asax中的
:
void Application_Start( object sender,EventArgs e)
{
RouteConfig.RegisterRoutes(RouteTable。路线);
}
public static void RegistRoute(RouteCollection routes)
{
routes.MapPageRoute( 主页, 主页, 〜/ ClientSide / Forms / Index.aspx);
}
但是当我想在href =Home中解决它时,我得到页面不存在的错误。
我该怎么办?
解决方案
Hello
I want to use RouteCollection in my asp.net web site.
What I have tried:
in Global.asax :
void Application_Start(object sender, EventArgs e) { RouteConfig.RegisterRoutes(RouteTable.Routes); } public static void RegistRoute(RouteCollection routes) { routes.MapPageRoute("HomePage", "Home", "~/ClientSide/Forms/Index.aspx"); }
but when I want to address it in href="Home", I get Error the Page does not Exist.
What should I do ?
解决方案
这篇关于如何在ASP.NET中使用routecollection?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!