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

moving to an anchor point programmatically

Hi,
Does anyone know how to programmatically move to a anchor point (a tag). I
am using vb.net. When the user presses a server-side control on the webpage,
I need to do some server processing and then I would like the resultant page
to have scrolled down half-way to the relevent part. Any help much
appreciated.
Nov 17 '05 #1
2 10770
When the page posts back, use RegisterStartUpScript() to add a script like
the following to your page, to be run as soon as the page loads:

<script type="text/javascript"><!--
document.location = "#tagName";
// --></script>

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"Craig Phillips" <cr****@smallfry.freeserve.co.uk> wrote in message
news:uM****************@tk2msftngp13.phx.gbl...
Hi,
Does anyone know how to programmatically move to a anchor point (a tag). I
am using vb.net. When the user presses a server-side control on the webpage, I need to do some server processing and then I would like the resultant page to have scrolled down half-way to the relevent part. Any help much
appreciated.

Nov 17 '05 #2
The easy way is to do a response.redirect to that spot:

Response.Redirect("mypage.aspx#tagName")

Note, however, that this forces two calls from the client. Not a problem if
you are using viewState and do not have a very large viewState, but not
optimal in all situations. Note, also, that this is largely an HTML/HTTP
problem.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

************************************************** **************************
****
Think Outside the Box!
************************************************** **************************
****
"Craig Phillips" <cr****@smallfry.freeserve.co.uk> wrote in message
news:uM****************@tk2msftngp13.phx.gbl...
Hi,
Does anyone know how to programmatically move to a anchor point (a tag). I
am using vb.net. When the user presses a server-side control on the webpage, I need to do some server processing and then I would like the resultant page to have scrolled down half-way to the relevent part. Any help much
appreciated.

Nov 17 '05 #3

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

Similar topics

4
by: bengee | last post by:
Hi First off - by the word "anchor" i DON'T mean a link, i.e. <a></a> tags I'm trying to position a <select> box inside a <div>. I can use relative positioning to set where the box should...
1
by: teranetsecurity | last post by:
I have a question. I'm working on this website with a treeview style menu coded in php. the menu autocreates itself by pulling data off a mysql database. It has the capabilities to get quite large...
1
by: Robert Mark Bram | last post by:
Hi All, We are using a scrolling iFrame to present a list of options to the user within the main page with an anchor against each option. Depending on the user actions, we jump to an anchor in...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
6
by: Nalaka | last post by:
Hi, Is there a gui control in VS2005 to set a "named anchor"? For an example now I go to the html and write the following code <a name="jumpToThisLocation"/>
3
by: axlq | last post by:
I wrote the function below to get the vertical scroll position of an anchor. That is, a URL of the form http://www.example.com/mypage.html#anchorname should scroll to the point on the page that...
0
by: Ginger Estherskip | last post by:
How do you programmatically start moving a SDI winform? Here's the issue: I've got a form as part of a tabbed MDI set, and I wrote it so that a user can "tear" the form off of the MDI by...
3
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
0
by: beaum | last post by:
For some reason when you click on an anchor point on the flash graphic, the second time it brings up a blank page, as if it is trying to think instead of as in the first click, jumping down the page...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.