Weird behavior with IE and datagrid

 

I am not sure how to classify this issue but I have some problems recently with IE and a datagrid. Well I have also the problem in different other controls.

To be totally sure I remove everything from my datagrid which has nothing with it, so now it's really a basic one.

Not only I can repeat the same steps below to see the problem arise on my machine, but on 5 other colleagues PC at least (didn't tried with Firefox).

OK here we go:

In the datagrid (dataset binded directly no cache at all),I have a basic Delete this record button. When I click on the button I call a delete method so nothing fancy there.

Next I bind the datagrid again to reflect the deletion and of course my deleted record disappear.

The project I am working on is under authentication, so this is where the things going very strange. Immediately after the record deletion I click on the Logout link, which call guess what... a Logout method. Then I enter again my credentials, call back the menu to access my Datagrid page and surprise, the deleted record is there !

Of course I checked in my db where the record is perfectly deleted. It's really a client side problem because if I refresh the page the Datagrid show the right information.

The only solution I found which create more problems is to change IE options and ask in the zone Temporary Internet Files -> Settings ->Check for newer versions of stored pages every time instead of automatically.

Also this behaviour happens also randomly on different controls, labels or textbox. For example, if I am logged as user A, my code display the user A on the bottom of the page. Fine. If I log out and log in as User B, User A is still there on the bottom!

I am sure I never had this problem few months ago.

Any idea?

4 Comments

  • Not an uncommon problem, you just have to make sure the logout routine refresh the page (like response.redirect itself), so it won't display the cached version again.

  • Alan this is what I am doing in the Logout method



    Sub Logout(ByVal objSource As Object, ByVal objArgs As EventArgs)

    FormsAuthentication.SignOut()

    Response.Redirect("~/Default.aspx", True)

    End Sub



    So yes I redirect but it seems that IE keep a client cahed version of the page.



    Andrew how to change an expiration header ??

  • Display the time on the page to make sure that is indeed a cached page.



    Once you confirmed that nothing's wrong with your logout (+session.abandon, kill the auth. cookie manually, etc.) but the problem's still there, you may have to hack it by adding a querystring to the sign out url or simply go to another page to guarantee that it actually loads up a new page.



    But I guess there may be something wrong with your authentication routine...


  • For starters,



    a) Are there any proxies in your network?



    b) Go to IIS, select the directory for this project and under HTTP headers, enable content expiration and set it to expire immediately.



Comments have been disabled for this content.