Answered by:
Anchor functionality in mobile controls

Question
-
User1399102720 posted
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.
Any suggestions?
Tuesday, August 28, 2007 12:57 PM
Answers
-
User1399102720 posted
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:
<a href="help.aspx#OrderPageHelp">
My help page would then have text that was sectioned by anchor tags. Each anchor tag would have a "name" attribute as follows:
<a name="OrderPageHelp">
<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:
<mobile:Link name="OrderPageHelp">
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, September 10, 2007 2:09 PM
All replies
-
User113421904 posted
Hi BobbyFrazier,
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:
http://msdn.microsoft.com/en-us/library/system.web.ui.mobilecontrols.link.aspx
Thursday, August 30, 2007 6:14 AM -
User1399102720 posted
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:
<a href="help.aspx#OrderPageHelp">
My help page would then have text that was sectioned by anchor tags. Each anchor tag would have a "name" attribute as follows:
<a name="OrderPageHelp">
<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:
<mobile:Link name="OrderPageHelp">
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, September 10, 2007 2:09 PM