Navigating to a bookmark on page?

J

John Carnahan

How would I accomplish the following ?
Navigate to a bookmark on a page from a routine in the code behind.

---- html code

bookmark1 (someplace on the page... is this an htmlanchor?)
?? how do I define the bookmark??

bookmark2 (somwhere else down the page)

-----

--- Code behind file

Sub GotoBookmark(byVal myBookmark As String)
' what goes here ??
?? NavigateToBookmark(myBookMark) ????
End Sub
 
A

alex bowers

Hi
this can be done. The html bookmark code is of the form
<A name='#bookmark1'></A>"
The server code that causes the browser to jump to it is
a script function that runs when the page loads
string script = "<SCRIPT
language='javascript'>location.href='#bookmark';</SCRIPT>"
;
Page.RegisterStartupScript("startupscript",script);

alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top