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

add anchor to url

Hi,

how can I add anchor to the url in a LinkButton click event handler. I
have an anchor already defined on the page, but there is no way to
scroll down to that location at postback.

thanks in advance.

Jul 7 '07 #1
3 2526
On Jul 7, 9:09 pm, Aamir Ghanchi <aamirghan...@gmail.comwrote:
Hi,

how can I add anchor to the url in a LinkButton click event handler. I
have an anchor already defined on the page, but there is no way to
scroll down to that location at postback.
you would need either to use a SmartNavigation attribute or a custom
js to restore scroll position

http://aspnet.4guysfromrolla.com/articles/111704-1.aspx
http://aspalliance.com/356

and many more http://www.google.com/search?hl=en&q...croll+position

Jul 7 '07 #2
Howdy,

ClientScript.RegisterStartupScript(this.GetType(), "anchorScroll",
"<script type=\"\">\n" +
"window.location.hash = 'myAnchor';" +
"</script>");

regards
--
Milosz
"Aamir Ghanchi" wrote:
Hi,

how can I add anchor to the url in a LinkButton click event handler. I
have an anchor already defined on the page, but there is no way to
scroll down to that location at postback.

thanks in advance.

Jul 7 '07 #3
On Jul 7, 5:58 pm, Milosz Skalecki [MCAD] <mily...@DONTLIKESPAMwp.pl>
wrote:
Howdy,

ClientScript.RegisterStartupScript(this.GetType(), "anchorScroll",
"<script type=\"\">\n" +
"window.location.hash = 'myAnchor';" +
"</script>");

regards
--
Milosz

"Aamir Ghanchi" wrote:
Hi,
how can I add anchor to the url in a LinkButton click event handler. I
have an anchor already defined on the page, but there is no way to
scroll down to that location at postback.
thanks in advance.- Hide quoted text -

- Show quoted text -
Thanks for the reponse folks.
Milosz, your solution worked out very well !
Thanks again.

Jul 9 '07 #4

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

Similar topics

2
by: Astra | last post by:
Hi everybody Need your help. I have a DB-extracted list of say 5 items per page, which have links on each one that takes you to more detailed info on the 'clicked' particular item. When you...
6
by: Daniele Baroncelli | last post by:
Hi guys, I would like to change the text in an anchor. es. from <a id="idanchor">oldtext</a> to
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
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......
4
by: CJ Taylor | last post by:
Hey, how do I use the anchor property? I have it set to Top, Left, but when I expand the form, it doesn't grow with it... What am I missing? Thanks, CJ
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
10
by: elibol | last post by:
Hi, Is there an event that fires when the back or forward button on a browser is pressed? I need an event to fire when someone clicks the back or forward button after an anchor has been set. ...
5
by: Randy Webb | last post by:
The list below has the current section number, proposed anchor name, and then the current title of that section. Some make sense, some don't. There are a few that don't have proposed anchor names...
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...
5
by: Meadock | last post by:
Here's an example of what i'm trying to do. At www.webpage.com/page1.php, there's a link that points to an anchor at www.webpage.com/page2.php. The syntax is: <a href="page2.php#anchor">Link</a>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.