Reputation: 1
How can I use asp.net 4.0 routing scheme to navigate an internal links in other page
the original page is something like this about.aspx#CEO I tried a lot with about/CEO
no way!!
Upvotes: 0
Views: 412
Reputation: 28990
You can read this - based on Page.GetRouteUrl
method
Link : http://msdn.microsoft.com/en-us/library/dd329551%28v=vs.100%29.aspx
In your Global.asax
file
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("test", "about/CEO", "~/about.aspx#CEO");
}
Use case
<asp:HyperLink ID="HyperLink2" runat="server"
NavigateUrl="~/about/CEO">
Test
</asp:HyperLink>
Upvotes: 1