Last post Sep 10, 2007 02:09 PM by BobbyFrazier
Aug 28, 2007 12:57 PM|BobbyFrazier|LINK
Has anyone ever been able to create the anchoring functionality in mobile applications using the asp.net mobile controls? I'd like to create a help link on every page of my mobile site that links to a Help.aspx page with target anchors. Problem is that the
<a> tag in mobile doesn't have the "name" or "id" attribute. So when the page is loaded it doesn't jump to the target <a> like I want it to. I need to have the entire help file shown otherwise I would just use panels.
This won't work in a normal IE browser or on the Smartphone emulator.
ASP.NET Mobile Controls
Aug 30, 2007 06:14 AM|Zhao Ji Ma - MSFT|LINK
Based on my understanding, you are trying to add a link to redirect to you help page. In ASP.NET Mobile Forms, please use the Link control to achieve this:
<mobile:Link ID="Link1" Runat="server" NavigateUrl="help.aspx">Link</mobile:Link>
For more detailes, you can check this link:
Sep 10, 2007 02:09 PM|BobbyFrazier|LINK
Sorry but that's not the issue. I can create a link to another page just fine. What I want to do is when I get to the other page, jump directly down the page to a specified section. In the NON-mobile world, It would look something like this:
My main pages would have a link like this:
My help page would then have text that was sectioned by anchor tags. Each anchor tag would have a "name" attribute as follows:
<p>Here's how to use the order page blah blah, blah, blah</p>
It is this "name" attribute that is not defaultly available to me using the <mobile:Link> tag even though the link tag simply renders an <a> tag.
I did find a way around it though. I had to extend the HTMLLinkAdapter and used the AddCustomAttribute method to allow for a new attribute called "name". By doing this I am able to get the "jump" to a section just like we do in the NON-mobile world by using
the mobile link as follows: