473,414 Members | 1,596 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,414 software developers and data experts.

How to jump to an anchor?

Hello there!

How is it possible to jump to an anchor by using ASP.NET? Is it only
possible by using JavaScript Code? If so, how has the JavaScript to look
like?

Thank you in advance,
Robert
Nov 17 '05 #1
2 2727
Cant recall the exact syntax but you can invoke an anchor in the onload
event of the page. Should be soemthing like this.

body onLoad="window.location.hash='anchorname'

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Robert Wehofer" <th*******@graffiti.net> wrote in message
news:Du******************@news.chello.at...
Hello there!

How is it possible to jump to an anchor by using ASP.NET? Is it only
possible by using JavaScript Code? If so, how has the JavaScript to look
like?

Thank you in advance,
Robert

Nov 17 '05 #2
This works for me..

Private Sub JumpToPage(ByVal cBookMark As String)

Dim script As String = "<SCRIPT
language='javascript'>location.href='#" & cBookMark & "'</SCRIPT>"

Page.RegisterStartupScript("startupscript", script)

End Sub

Nov 18 '05 #3

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

Similar topics

5
by: TG | last post by:
Dear PHP Group, How can I in PHP, based on a result, move the cursor to a certain location on the page? I want the same result as Anchor tags in HTML. I want to go to a certain section of the...
3
by: Daniel Goldman | last post by:
When I open a new popup window, with a url that includes an anchor, about 1/5 of the time the page displays correctly (jumps to anchor), 4/5 of the time page displays incorrectly (starts from...
2
by: Rob | last post by:
Hello all, I have an anchor in my page like <a name-"phase_two"/>. When I load my page I call the function body_onload in the onload event of the body tag. Then I like to jump to this...
1
by: Mel | last post by:
i am reading html pages from files, once i read and display the contect, i want to go to the end of that page that could be several 100 lines long. i need a java script to execute after i placed...
16
by: darrel | last post by:
I have an anchor on my page: <a name="monkey"></a> I can easily go to this via a redirect, but is there a way to jump to this on postback? -Darrel
6
by: dark.peony | last post by:
Hi, (--1--) I'm trying to find a way to jump to a link (<a href="ref"></a>) in a page that is generated with javascript. The source view of the page only shows the javascript methods. The...
2
by: Eadwine Rose | last post by:
I have this little bitty script on my site that makes a jump to the top of the screen when one double left clicks anywhere in the page. I was wondering if it could be altered so the double left...
3
by: Bjorn Nordbo | last post by:
Hello, I have a page with a vertical list of photos separated with bits of text. Using page down to view the photos is a bit annoying as it will typically cut the photos as it only jumps a...
3
by: wavedancer | last post by:
I am trying to get a link back to the top of the page I'm on. For the anchor, I've got <a name="topofpage" id="topofpage"></a> and for the link I've got <p><a href="#topofpage">back to the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.