473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 3847
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 within the page loaded within the iframe without...
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 ADP I'm working on. Dim rs As ADODB.Recordset...
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. subform: views whole table(datasheet view). When...
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 webpage bookmarks in possibly one file. I want it...
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. When they bring up my page and then try to add a...
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 clear session variables when user is navigating to...
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 Fields1-3 on Page 1, Fields 4-6 on Page 2, etc. In...
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 an error I would wish to return to the top of the...
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 event, cancelling it, and performing my own operations...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.