473,657 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can you jump to an anchor on postback?

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
Nov 19 '05 #1
16 9909
check out using SmartNavigation for returning to the correct place on a page
after a post back

HTH

Ollie Riches

"darrel" <no*****@hotmai l.com> wrote in message
news:em******** ******@TK2MSFTN GP15.phx.gbl...
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

Nov 19 '05 #2
Sure. Just add a JavaScript to the page that does the "redirect" -

<script type="text/javascript"><!--
document.locati on = "thispage.aspx# bookmark";
// --></script>

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmai l.com> wrote in message
news:em******** ******@TK2MSFTN GP15.phx.gbl...
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

Nov 19 '05 #3
check out using SmartNavigation for returning to the correct place on a page after a post back


Ha! The first result from google is:

"Smart navigation is more of a pain than good."

;o)

I'll look into it, though I'm thinking Kevin's answer might be the solution.
Not a big fan of javascript for this, but since this is on an intranet, it's
not as big of a deal.

-Darrel
Nov 19 '05 #4
> Sure. Just add a JavaScript to the page that does the "redirect" -

<script type="text/javascript"><!--
document.locati on = "thispage.aspx# bookmark";
// --></script>


Hmm...does that reload the page or merely jump to the anchor? Would this
work as well:

document.locati on = "#bookmark" ;?

-Darrel
Nov 19 '05 #5
SmartNavigation is not a pain at all as long as you remember some very
important folders, make sure that the folders with the prefix '_vti_' are
included in the root directory of the installed asp.net application
otherwise you will see funny behaviour with SmartNavigation , by default they
are installed in \Inetpub\wwwroo t automatically so you don't have to worry
about it if your asp.net application resides under this directory.

Also it only works in IE I believe, it does work in Firefox (Mozilla).

HTH

Ollie Riches
"darrel" <no*****@hotmai l.com> wrote in message
news:OL******** ******@TK2MSFTN GP10.phx.gbl...
check out using SmartNavigation for returning to the correct place on a page
after a post back


Ha! The first result from google is:

"Smart navigation is more of a pain than good."

;o)

I'll look into it, though I'm thinking Kevin's answer might be the

solution. Not a big fan of javascript for this, but since this is on an intranet, it's not as big of a deal.

-Darrel

Nov 19 '05 #6
> Not a big fan of javascript for this, but since this is on an intranet,
it's
If you're not a big fan of JavaScript, you might as well forget about
ASP.Net, which relies heavily upon JavaScript for much of its functionality
(ViewState, PostBacks, etc)!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmai l.com> wrote in message
news:OL******** ******@TK2MSFTN GP10.phx.gbl...
check out using SmartNavigation for returning to the correct place on a

page
after a post back


Ha! The first result from google is:

"Smart navigation is more of a pain than good."

;o)

I'll look into it, though I'm thinking Kevin's answer might be the
solution.
Not a big fan of javascript for this, but since this is on an intranet,
it's
not as big of a deal.

-Darrel

Nov 19 '05 #7
Sure. Six of one of half of one of half of a dozen of the other.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmai l.com> wrote in message
news:eG******** ******@TK2MSFTN GP12.phx.gbl...
Sure. Just add a JavaScript to the page that does the "redirect" -

<script type="text/javascript"><!--
document.locati on = "thispage.aspx# bookmark";
// --></script>


Hmm...does that reload the page or merely jump to the anchor? Would this
work as well:

document.locati on = "#bookmark" ;?

-Darrel

Nov 19 '05 #8
Also it only works in IE I believe


Hmm...well, there's my reason not to use it, I guess.

-Darrel
Nov 19 '05 #9
If you're not a big fan of JavaScript, you might as well forget about
ASP.Net, which relies heavily upon JavaScript for much of its functionality (ViewState, PostBacks, etc)!


It's ridiculous, IMHO. I end up having to simply write a lot of workarounds
for it.

A server side language should not be dependant on client-side scripting, but
MS, as usual, took the easy way out on a lot of the built-in control
behaviors.

They're actually great to whip up quick interfaces on intranets where you
can control the client-side environment to an extent, but useless on the
greater web if accessibility is a concern.

IMHO, of course.

-Darrel
Nov 19 '05 #10

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

Similar topics

2
6513
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 anchor/bookmark based on the value of an variable. pseudecode example: function body_onload(){
3
6027
by: Quintus Snapper | last post by:
Hi All, I'm having a problem with an anchor link in IE which is working inconsistantly and I can't figure out why. On the following website: http://www.friendlyrentals.com/ If you click on an apartment to go to a detail page, if you scroll
1
6255
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 the frame with code like this: theFrameSrc = theFrame.src; theFrame.src = theFrameSrc + "#" + anchorName;
0
1155
by: Jeff Jarrell | last post by:
I want to know how to initiate a postback with parameters from an anchor tag. There are many anchor tags and they are dynamic. I see some sites with the postback coming through some javascript in the HREF but I don't know if the java script is coming out of a server side control or if it was manually added to the page. Thanks, jeff
8
4797
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I have a web page divided into two major segments, with the top segment fixed and the bottom segment allowed to scroll, thus giving the look of frames without frames. I also have anchors so that users can click on a letter of the alphabet to jump...
1
2171
by: sridev | last post by:
Hai all, I am working in ASP.NET. I my page I am having two user controls as usercontrol1, usercontrol2 In usercontrol1, i am having two anchor control and i will load the text for anchor control dynamically. In usercontrol2, i am having decription for the anchors in usercontrol1. My question is How can i move to the corresponding description
6
2921
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 HTML is *not* visible in the source view.
3
6313
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 screenfull at a time. To work around this I added an anchor just before every photo, so that the page was organised as follows: <a name="1" id="1"/>
4
2370
by: Eric | last post by:
I have a linkbutton on a form that executes a script, it works fine except that it posts back to the calling form first. Is there a way to prevent this? I tried setting the PostBackURL property to the form the script launches but that resulted in some strange behavior. TIA
0
8315
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5633
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.