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 .
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
"About.aspx#CEO
Member
2 Points
38 Posts
UrlRouting for internal links in Dynamic Data
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
no way!!
</div>All-Star
17916 Points
5681 Posts
MVP
Re: UrlRouting for internal links in Dynamic Data
Nov 24, 2012 10:04 AM|sjnaughton|LINK
Are these internal pages other DD pages?
Always seeking an elegant solution.
Member
2 Points
38 Posts
Re: UrlRouting for internal links in Dynamic Data
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 ??
All-Star
17916 Points
5681 Posts
MVP
Re: UrlRouting for internal links in Dynamic Data
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
Page.Request.UrlReferrer.PathAndQuery
you can then do
If(!IsPostBack)
HyperLink1.NavigateUrl = Page.Request.UrlReferrer.PathAndQuery + "#CEO";
hope that helps you need to do this in the page init or load.
Always seeking an elegant solution.
All-Star
94130 Points
18109 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 24, 2012 09:58 PM|Decker Dong - MSFT|LINK
Hi,
I come here to check whether the problem is solved by the nice MVP or not……Welcome to feedback in detail information.
Member
2 Points
38 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 25, 2012 08:25 AM|Web Developer1|LINK
Thanks in advance Decker Dong but still nor solved i'm trying to solve it ...
All-Star
94130 Points
18109 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 25, 2012 08:27 PM|Decker Dong - MSFT|LINK
So can you show your codes?
Participant
900 Points
478 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 26, 2012 03:42 AM|Hisham.NET|LINK
Hi sjnaughton
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 "About.aspx#CEO
All-Star
17916 Points
5681 Posts
MVP
Re: UrlRouting for internal links in Dynamic Data
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.
Always seeking an elegant solution.
Participant
900 Points
478 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 26, 2012 05:31 AM|Hisham.NET|LINK
Hi ...
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?!!
All-Star
17916 Points
5681 Posts
MVP
Re: UrlRouting for internal links in Dynamic Data
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 :)
Always seeking an elegant solution.
Participant
900 Points
478 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 26, 2012 06:30 AM|Hisham.NET|LINK
Hi ...
The problem which I facing in routing, this is what i wrote in global.asax
All-Star
17916 Points
5681 Posts
MVP
Re: UrlRouting for internal links in Dynamic Data
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 #
Always seeking an elegant solution.
Participant
900 Points
478 Posts
Re: UrlRouting for internal links in Dynamic Data
Nov 26, 2012 07:32 AM|Hisham.NET|LINK
Hi ..
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 ..
All-Star
17916 Points
5681 Posts
MVP
Re: UrlRouting for internal links in Dynamic Data
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.
Always seeking an elegant solution.