Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having a problem. My site again and again re-scrolls to its previous state whenever the ads in the site change in IE 8+ but not in Mozilla.

I don't know how to solve the problem, please help me.
Posted
Updated 24-Jun-10 17:56pm
v3
Comments
Sandeep Mewara 24-Jun-10 15:47pm    
what do you mean by 'adds'? Do you want to say 'ads'?

Further, how come application would autoscroll itself. Have you written any code on ad-change? If so, what?
nishi2010 25-Jun-10 7:14am    
No, there is no code for ad-change.The ads are in update panal .I have given two seperate ads for the site in two different rows of a table in the right side one after another .But the problem is that when first ad changes, the site scrolls to that position if it is in upper portion and if it is in lower portion the site scrolls to lower one.

1 solution

Try this...

Page.MaintainScrollPositionOnPostBack = false;
 
Share this answer
 
Comments
nishi2010 26-Jun-10 13:49pm    
Thanks for your reply .I hope this will helps me.
nishi2010 28-Jun-10 14:54pm    
Sir ,i had apply this but it is not working,Please tell me wheather i have to assign the value to true or false and i had place this code in my master page page load event,is it right? Reply me soon its too urgent.
thanks
Richard Hauer (5 Limes) 29-Jun-10 0:20am    
As written in the above suggestion, the value should be 'false'.
I believe you have to set it at the Page level (and not in the masterpage) or I suppose you could create a base class for page if you want to set it globally.
You can set the property in the ASPX file itself by using the @ Page tag thus:

<% @ Page MaintainScrollPositionOnPostback="false" %>

Note that false is the default so you may be setting it to true somewhere already.
nishi2010 29-Jun-10 4:04am    
Thanks for your reply .I try this and after that i tell you what will happen.
nishi2010 30-Jun-10 8:12am    
Hi, I had use this but it is not working .The main problem is due to our update panel in which we have used ads ,the page scroll due to asynchronous postback of update panel.What will be the solution of this ? Please tell me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900