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

Can't maintain page position


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
Nov 19 '05 #1
4 1129
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.

"Carlos" <ch******@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...

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

Nov 19 '05 #2
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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


Nov 19 '05 #3
Thank you all.

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:42**********************@msnews.microsoft.com ...
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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


Nov 19 '05 #4
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.

"Marina" wrote:
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.

"Carlos" <ch******@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...

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


Nov 19 '05 #5

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

Similar topics

2
by: GrantS | last post by:
I am trying to convert the VB.Net code example povided by http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx into C# (ASP.Net)without success. No errors are thrown in the VB...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
4
by: GrantS | last post by:
I am trying to convert the VB.Net code example povided by http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx into C# (ASP.Net)without success. No errors are thrown in the VB...
0
by: GrantS | last post by:
I am trying to convert the VB.Net code example povided by http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx into C# (ASP.Net)without success. No errors are thrown in the VB...
0
by: Keithb | last post by:
The maintain scroll position on postback feature works as expected with my site running under localhost on the development machine. When the files are posted to an IIS 6.0 web server running on a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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...

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.