I am having a really annoying issue where the page visibly jumps to the top and then to the previous scroll position on a postback.
Some details: I have an ASP.NET (VS 2010, .Net Framework 4.0) page that is using a set of RadioButtons in a RadioButtonList to display and hide a couple of Panels depending on which RadioButton is selected. There are also a couple of other controls on the page that cause the page to post back to the server. I have the MaintainScrollPositionOnPostback page attribute set to "true".
Functionally all of this works fine. The problem is visually the page jumps to the top when reloaded and then jumps down to the previous scroll position. But only in some browsers. I have tested this on my development machine using IE 9, Chrome and Firefox. My boss is testing it only in IE 9. On my development machine it works perfectly in IE 9 (oddly enough) but not in Chrome or Firefox. In IE the page sits there as it looked before the post back and then simply displays or hides the panel maintaining the previous scroll position the entire time. Looks great. In Chrome and Firefox, when the page reloads, it jumps to the top of the page and then jumps down to the previous scroll position and is really annoying to observe. The kicker is, on my bosses machine, she is also using IE 9. In fact it is the exact same version I am running but on her machine she is seeing the the same behavior that I am seeing in Chrome and Firefox.
I have tried adding the following meta tags, in every combination conceivable, but they have not done anything to help solve this issue.
<meta http-equiv="Page-Enter" content="Alpha(opacity=100)" />
<meta http-equiv="Page-Exit" content="Alpha(opacity=100)" />
Am I going to need to re-architect this page to use an UpdatePanel to resolve this issue or is there another way? What am I missing here?
Well . . . This is not really the answer but I solved the issue bu adding some Update Panels to the page and it works great.
I'm still curious about the issue and if someone would like to weigh in on it I'll continue to monitor this post to see what you have to say about it.
You should consider taking advatage of a JavaScript workaround that leverages the __LASTFOCUS hidden field. It is documented in this CodeProject article:
http://www.codeproject.com/Articles/17571/Maintain-focus-between-postbacks-in-ASP-NET-al
Related
In VS2010 working on an ASP.NET project, when opening an ASPX page in the IDE and viewingin Design mode, the vertical scrollbar is disabled. The horizontal scrollbar remains enabled. It doesn't seem to matter what page I open. Note that I am using a single Master page.
I have tried searching other posts, including running “devenv /resetsettings”
http://forums.asp.net/t/1149955.aspx?Scroll+Bar+doesn+t+show+up+in+Design+View+
however this didn't solve it. This thread also makes mention of the actual content itself (ie "overflow-x: hidden;") being a potential cause, however that would be pathetic if source code affected how the IDE's vertical scrollbar behaves.
Any help would be most appreciated. Thanks.
David
I manage ajax browser history using asp.net's(v. 4.0) EnableHistory="true" of the ScriptManager & everything has worked fine till today.
I fire my browser from localhost today and I get this error message in IE 9 (only IE)
Message:
Sys.InvalidOperationException: For the
history feature to work in IE, the
page must have an iFrame element with
id '__historyFrame' pointed to a page
that gets its title from the 'title'
query string parameter and calls
Sys.Application._onIFrameLoad() on the
parent window. This can be done by
setting EnableHistory to true on
ScriptManager.
I've undone all modifications I made today, cleared my browser cache+cookies+history+everything and deleted "Temporary ASP.NET Files" both from the Windows and Temp folders but this error wont go away.
Deleting <meta http-equiv="X-UA-Compatible" content="IE=7" /> from my master page however gets rid of the error but its not an option as a lot of styling goes wrong. The meta has been there from the start and everything has worked so my question is why now?
Any pointers to further reset my environment(e.g deleting some hidden files) or some light into what might be going on will be helpfull.
Thanx.
The ScriptManager outputs an iframe to make history management work correctly in IE7. In this case, unfortunately, there is a bug. Your browser is IE9, so it figures you don't need the iframe. But your meta tag makes the client-side behave as IE7, so it does need the iframe. It will be fixed in the next rev of .NET. Until then, you should be able to work around the problem by looking at the iframe content that is rendered when you use compat mode, or an actual IE7, and mimicking that in your page. But you need to make sure it doesn't end up in the page twice when it really is IE7, so only output it if you detect IE >= 8. Make sense, I hope? :)
I'm getting a difference in my design view and what the actual preview displays. I'm pretty sure my code is correctly reflecting what appears in the design view, but incorrectly in the browser preview. Any suggestions on how I can fix this and why this is happening? The black content area should be below the header and buttons.
Master Page Design View: http://imageshack.us/photo/my-images/30/designview.jpg/
Browser Preview: http://imageshack.us/photo/my-images/638/browserpreviewz.jpg/
IE and Chrome both display the same behavior.
Here is the code of the master page: (because of '<' I'm having getting asp code in here...how do I enter it in as code sample?)
Personally, I find i can never trust the web preview in visual Studio, so while this is not really an answer to your specific question I recommend you always use an actual browser for preview. :)
Your CSS might be cached. When you are looking at the web preview, It is worth a try to reload the page and the CSS by clicking ctrl-F5 (not just F5). This worked for me a few times when I felt that my CSS changes are not being rendered in the web preview.
For a specific website (internal to network, coded in XHTML) the behavior in IE6 was that when ever the window is re-sized or restored the page refreshes.
Since IE6 doesn't have tabs I upgraded to IE7 - but the problem with IE7 is whenever we switch from one tab to another, its makes the active tab's page to refresh, and this happens all the time.
After googling a bit, I found a temporary solution, (to disable the Meta-Refresh property in IE settings). This has resolved the problem to some extent but still refreshes happens.
Is there a way to permanently disable the refreshing of page when tabs are switched ?
In my opinion your solution is to use something along the lines of:
<!--[if IE #]>
Special instructions for IE # here
Rather than on restored just leave your code to refresh in resize.
Depending on what your page is doing you most likely may not need it to
refresh on resize using IE8+.
<![endif]-->
Otherwise I would just plan on the IE8+ being the used browser and not worry about what it does in IE6 anymore.
If you have used the ASP.Net menu control on your website and recently updated your browser to IE8, you will probably have noticed your menu no longer renders properly. You may also have noticed this in Firefox as well. The menu will probably look just fine in IE6 & IE7.
So why is the ASP.Net menu being padded with space and why don't the drop downs render in IE8?
First of all let me explain I am not claiming this as my solution but I thought I would post the question and solution here because it took me a while to find it.
After a bit of searching it turns out there are two problems. One is a problem with .Net2.0 on your server and the second to do with the menu control adding some rubbish into your menu.
(1) Down load and update your server with MS hotfix KB969612
HotFix Link
(2) Read up on how Sakyad found the solution of adding this property to your menu control
SkipLinkText=""
Sakyad solution
(3) Happy Rendering!