Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling an anchor

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I want to call an anchor when a user click a button so it doesn't go to the top of the page when the user clicks the button. Can someone tell me how to do this?

Scott
 
lol I just finished doing this before Christmas! Just let me find that code.
*runs off to retrieve code....
aha here we are in the html add an anchor in this case I called it #AvailableSites. Then in the code behind put this code in. When your page returns from the post back it will relocate itself at your locator.

'move the page to the Available Sites Location
sb.Append(&quot;<Script Language=Javascript>&quot;)
sb.Append(&quot;location.href='#AvailableSites'&quot;)
sb.Append(&quot;</Script>&quot;)

RegisterStartupScript(&quot;Locator&quot;, sb.ToString)
That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
glad to help man That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top