Last post Nov 26, 2012 07:35 AM by sjnaughton
Nov 24, 2012 09:55 AM|Web Developer1|LINK
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
Nov 24, 2012 10:04 AM|sjnaughton|LINK
Are these internal pages other DD pages?
Nov 24, 2012 10:42 AM|Web Developer1|LINK
internal link not pages...
suppose i have aboutus page inside it i have internal link ,suppose i have a menu in default page ,in that menu there is aboutus page and subminue from it clled CEO,from this link how i can navigate to CEO part in aboutus page .
did u get it ??
Nov 24, 2012 10:53 AM|sjnaughton|LINK
OK I generally use the Rquest to get the current URL and then you could append the internal url like this
you can then do
HyperLink1.NavigateUrl = Page.Request.UrlReferrer.PathAndQuery + "#CEO";
hope that helps you need to do this in the page init or load.
Nov 24, 2012 09:58 PM|Decker Dong - MSFT|LINK
I come here to check whether the problem is solved by the nice MVP or not……Welcome to feedback in detail information.
Nov 25, 2012 08:25 AM|Web Developer1|LINK
Thanks in advance Decker Dong but still nor solved i'm trying to solve it ...
Nov 25, 2012 08:27 PM|Decker Dong - MSFT|LINK
So can you show your codes？
Nov 26, 2012 03:42 AM|Hisham.NET|LINK
I wanna clarify the question, assume you have a page named "About.aspx" it contains many internal links as example "CEO", the problem come when I try to access the internal link via a proper route "/About/CEO". How can I map that route to the original link
Nov 26, 2012 05:23 AM|sjnaughton|LINK
Hi Hisham, this issue here is a DynamicData page template is routed as a DynamicDataRoute and so does not follow the same as a normal web form.
Nov 26, 2012 05:31 AM|Hisham.NET|LINK
Assume I have a web form in CustomPages folder and contacins two sections, how can i route to the internal link to reach the 2nd section?!!
Nov 26, 2012 05:52 AM|sjnaughton|LINK
I would add a static ID to your section you can do this by surrounding by a DIV or setting
then as I showed above use the Request URL and add #<ID> where ID is the statics ID of the html element :)
Nov 26, 2012 06:30 AM|Hisham.NET|LINK
The problem which I facing in routing, this is what i wrote in global.asax
routes.MapPageRoute("test", "About", "~/About.aspx#CEO");
Nov 26, 2012 07:07 AM|sjnaughton|LINK
to generate routes like that you will need to write you own custom Route Handler as I do not believe the default one will handle the #
Nov 26, 2012 07:32 AM|Hisham.NET|LINK
Do you think Microsoft forgot this situation?!! I did a trcik using
but i'm still fighting to find a solution using pure routing technique ..
Nov 26, 2012 07:35 AM|sjnaughton|LINK
It's not something I have ever thought about using before this thread, I am however thinking about it now though, I will try and have a lok today.