473,503 Members | 1,869 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 9872
check out using SmartNavigation for returning to the correct place on a page
after a post back

HTH

Ollie Riches

"darrel" <no*****@hotmail.com> wrote in message
news:em**************@TK2MSFTNGP15.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.location = "thispage.aspx#bookmark";
// --></script>

--
HTH,

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

"darrel" <no*****@hotmail.com> wrote in message
news:em**************@TK2MSFTNGP15.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.location = "thispage.aspx#bookmark";
// --></script>


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

document.location = "#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\wwwroot 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*****@hotmail.com> wrote in message
news:OL**************@TK2MSFTNGP10.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*****@hotmail.com> wrote in message
news:OL**************@TK2MSFTNGP10.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*****@hotmail.com> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
Sure. Just add a JavaScript to the page that does the "redirect" -

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


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

document.location = "#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
Hello darrel,
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.


Please do tell how you except a web application not be dependent on client
side scripting. Also, Im interested to hear in how Microsoft "as usual, took
the easy way out".

This is not a fault of Microsoft, but rather the very nature of HTML.

--
Matt Berther
http://www.mattberther.com

Nov 19 '05 #11
> Please do tell how you except a web application not be dependent on client
side scripting.
We've been doing it that way for years.
Also, Im interested to hear in how Microsoft "as usual, took
the easy way out"
This is not a fault of Microsoft, but rather the very nature of HTML.


Many of the built in controls require javascript. They could have built the
workarounds themselves...just like I am doing. Is it as elegant? No. But
it's accessible.

As for being lazy...look at client-side form validation and the Ollie's
comment on smart navigation both being dependant on IE. That's laziness.
Take the fact that a datalist using columns and an odd-number dataset can't
generate a compliant table without workarounds. That's laziness. Take the
fact that datagrids and other table-based controls don't give you default
options for table headers and such. Laziness. The fact that VS.net still
messes with my HTML...a known bug by MS that they just don't want to fix.
Laziness.

And MS isn't alone in this...seems to be defacto for software development
these days. ;o)

-Darrel
Nov 19 '05 #12
> This is not a fault of Microsoft, but rather the very nature of HTML.

FYI, HTML is what it is. The web protocols are what they are. It's a
stateless environment. MS chose to work around this with viewstates and
postbacks and depending on client-side scripting. There simply is a tradeoff
here.

I think it's great for controlled environment application development. I
think the tradoffs start to show when developing public-facing web sites
where accessibility is a priority.

-Darrel
Nov 19 '05 #13
One man's laziness is another man's productivity.

--
HTH,

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

"darrel" <no*****@hotmail.com> wrote in message
news:Oy**************@TK2MSFTNGP09.phx.gbl...
Please do tell how you except a web application not be dependent on
client
side scripting.


We've been doing it that way for years.
Also, Im interested to hear in how Microsoft "as usual, took
the easy way out"
This is not a fault of Microsoft, but rather the very nature of HTML.


Many of the built in controls require javascript. They could have built
the
workarounds themselves...just like I am doing. Is it as elegant? No. But
it's accessible.

As for being lazy...look at client-side form validation and the Ollie's
comment on smart navigation both being dependant on IE. That's laziness.
Take the fact that a datalist using columns and an odd-number dataset
can't
generate a compliant table without workarounds. That's laziness. Take the
fact that datagrids and other table-based controls don't give you default
options for table headers and such. Laziness. The fact that VS.net still
messes with my HTML...a known bug by MS that they just don't want to fix.
Laziness.

And MS isn't alone in this...seems to be defacto for software development
these days. ;o)

-Darrel

Nov 19 '05 #14
> One man's laziness is another man's productivity.

:o)

-Darrel
Nov 19 '05 #15
Hello darrel,
Many of the built in controls require javascript. They could have
built the workarounds themselves...just like I am doing. Is it as
elegant? No. But it's accessible.
Would you mind describing the workarounds you're talking about?
As for being lazy...look at client-side form validation and the
Ollie's comment on smart navigation both being dependant on IE. That's
laziness. Take the fact that a datalist using columns and an
odd-number dataset can't generate a compliant table without
workarounds. That's laziness. Take the fact that datagrids and other
table-based controls don't give you default options for table headers
I'll give you those. The controls arent perfect, but your statement was pretty
broad.
and such. Laziness. The fact that VS.net still messes with my HTML...a
known bug by MS that they just don't want to fix. Laziness.
This has been resolved in VS.NET 2005.

And MS isn't alone in this...seems to be defacto for software
development these days. ;o)


Without question, you're right there. There has been a definite propensity
by software developers to just hack and bang stuff together and hope that
it works. No regard to proper OO design. If it works, its right. And thats
too bad.

--
Matt Berther
http://www.mattberther.com

Nov 19 '05 #16
> > Many of the built in controls require javascript. They could have
built the workarounds themselves...just like I am doing. Is it as
elegant? No. But it's accessible.


Would you mind describing the workarounds you're talking about?


Well, the workaround, for me at least, is to depend on lots of querystrings
with redirect and/or setting viewstate properties in the codebehind. I just
can't accept postbacks triggered via javascript on the public site I'm
working on.

-Darrel
Nov 19 '05 #17

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

Similar topics

2
6498
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...
3
6022
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...
1
6211
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...
0
1140
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...
8
4782
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...
1
2163
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...
6
2900
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...
3
6300
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...
4
2362
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...
0
7348
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...
1
7006
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
7467
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...
1
5021
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
4685
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...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
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 ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
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...

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.