472,347 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,347 software developers and data experts.

Navigating to a bookmark on page?

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
Nov 17 '05 #1
3 3756
I don't think it's doable on the server side. I just do a Redirect to the
same page, and put the anchor in the URL,

http://mysite/mywebform.aspx#anchorname

"John Carnahan" <ca********@msn.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
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

Nov 17 '05 #2
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
-----Original Message-----
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
.

Nov 17 '05 #3
Alex,
Thanks alot...
worked perfectly!
John
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Adrian | last post by:
Hi All, I load an Iframe within html page contained within another page and from the hosting page I would like to scroll to a given bookmark...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an...
1
by: ken | last post by:
What is the best way to do this: Table with primary key autonumber field and some text fields. main form: views this table one record at a time....
6
by: Chris | last post by:
I have been learning C and want to write a program and need someone to point me in the write direction. I want to write a program to store all my...
2
by: Tom | last post by:
I have an ASP.NET page called Login; however, I would like it to have a different 'default' name when someone attempts to bookmark the page. I.E....
1
by: ABC | last post by:
Can I find out when the user is navigating to another page? or What events will be call if the page is change to another page? I want to call...
1
by: JohnMOsborn | last post by:
I am designing an Access database that will use tab controls. Normally, you place different sets of fields on each page of the tab control – like...
4
by: zzapper | last post by:
Hi, I use an internal bookmark <form method="post" action="${form_action}#mark1"> to return to the correct place in the page. In case of...
0
by: in10se | last post by:
I have a .NET 2.0 application that uses the WebBrowser control. Because all of my pages are generated dynamically, I am catching the Navigating...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.