Can't maintain page position

C

Carlos

Hi all,

I have an asp .net page that has a calculation in the middle of the page.
My problem is that when the user hits the button to calculate, the page
jumps to the top of the page whenever it performs the calculation.

Is there a way to prevent this?

Thanks,

Carlos
 
M

Marina

3 options that I can see:

1) Make the calculation client side. Then the page does not need to go to
the server
2) Add client side code that uses XmlHTTP to make a call to the server. Your
calculation code can still be on the server, but the page does not need to
refresh. I think this limits your users to those with IE 5.5 and above
3) Turn on smart navigation. This is known to not be too stable, at times
causing javascript errors.
 
B

Brock Allen

Either enable smart nagivation (only for IE browsers though):

<%@ Page SmartNavigation=true ... %>

Or write your own java script that calls window.scrollTo with the scroll
position prior to the submit. This is built into ASP.NET 2.0, BTW.
 
C

Carlos

Thank you all.

Brock Allen said:
Either enable smart nagivation (only for IE browsers though):

<%@ Page SmartNavigation=true ... %>

Or write your own java script that calls window.scrollTo with the scroll
position prior to the submit. This is built into ASP.NET 2.0, BTW.
 
G

Guest

Your options as soon as your website grows up.

1.) In my scenario I am creating Server Controls dynamically server side.
These controls will then create an event that will require database access.
So I can't make this calculation in my scenario client side.

2.) I can't limit myself to I.E. 5. Ideas like this make me recall many
things that have lived and died because web browsers should be Open
Environment. Although they aren't there are some defacto behaviors because
of language adoptions like javascript/html/xml. At first blush I thought
this was the route until I saw I.E. 5.5 and above only.

3.) I a have pretty widely used .js file that produces a calender date time
picker client side and sure enough SmartNavigation just isn't smart enough.

So here is where I am at currently. I am trying to use something like
Page.RegisterStartupScript yet it places my javascript just before the
closing "form" tag. If you test "window.scroll(x, y);" you will find just
one spot it will work. Just before the closing "body" tag.

GEEZ PLEASE SOMEONE HELP ME WITH THIS!!!

apolfj.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top