IE6 postback in asp.net

爷,独闯天下 提交于 2019-12-23 03:28:16

问题


I have a page that contains a user control that is just a personalized dropdown list . I assign to each item the attribute onClick=__doPostBack('actrl',0).

when I click the page postback fine and I got the expected results. However in IE6 my page doesn't change to the new values loaded from the server.

The weird thing is that when I shift + click on the link The page reload fine with all changes.

I tried to disable caching on the page but no luck.

using all this code

Response.CacheControl = "no-cache"
Response.AddHeader("Pragma", "no-cache")
Response.Expires = -1
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Page.Response.Cache.SetExpires(DateTime.Now.AddDays(-30))
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache)
Page.Response.Cache.SetNoServerCaching()
Page.Response.Cache.SetNoStore()
Response.Cache.SetNoStore()

Also when I debug the application I can see that the generated html to be rendered is correct, but it is not rendered.

This problem happens only in IE6.


回答1:


This is a known IE6 bug (#223) with magical HTTP get requests.

See the bug here: http://webbugtrack.blogspot.com/2007/09/bug-223-magical-http-get-requests-in.html

It happens when an inline event handler causes a page change in IE6.




回答2:


The problem is that IE6 is not reloading the page from the server (its just grabbing the cached copy), however on a form post IE6 SHOULD reload. Why are you adding the _doPostBack as an attribute, those should be autogenerated on any asp.net control that needs to post back.



来源:https://stackoverflow.com/questions/206595/ie6-postback-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!