Old Age Problem: Refresh Button Causes Postback

Posted on 2009-04-17
Last Modified: 2012-06-27
This is an old problem,, but I never had it so bad like this before,,
the events are refiring when clicking the Browser refresh button.
In the Submit button in my webform, I capture the server side click
event and I update session information to track the visibilty of some
panels in a wizard type navigation ("Next >>" and "<< Back" buttons)..
but the refresh button makes another event firing and takes the whole
thing to a Choes..

redirection to the same page/ saving state in a database is dumb and
should not be mentioned as an answer .. and Please, don't reply if you
are guessing.

Question by:ajay_dhakare
    LVL 39

    Accepted Solution

    > redirection to the same page/ saving state in a database is dumb > and should not be mentioned as an answer ..
    ok, interesting thought about a well known technique ;) though I don't think it has anything to do with your problem

    > and Please, don't reply if you are guessing.

    that's tricky. You didn't provide any sources to replicate your problem with, and without seeing what's going on it will be a guessing game regardless. Should we then not answer or try to help you?

    Of course not. No offense meant, but I will guess at some things you might consider for finding a solution:

    • you say that you click on a submit button and then on Refresh in the browser, result: back to original page. Normally, you should get a warning from the browser about resubmitting the page. Are you using javascript or a non-post style method, or are you using an ajax technique for updating parts (asp:UpdatePanel)
    • normally, if you click refresh on the browser (I assume you mean Ctrl-R/F5 and not a button on your form) it should refresh, i.e., the original page comes back (assuming not a re-post). There may be some bug in your this.IsPostBack branches in Page_Load
    • you mention that another event is triggered via your submit button. That can only be any of the page_xxxx events, or an event you call manually from the submit button click event. Please check your page events whether they contain resetting information
    I would understand it if the above doesn't really help, but if so, please provide some extra information, preferably the code of your page or a reproducible sample.

    -- Abel --

    PS: you posted in the C# zone, you may want to try the ASP.NET zones, because your problem seems more applicable there. You can ask the moderators to change your zones.
    LVL 39

    Expert Comment

    In your question you are quite clear that you do not want unclear answers, yet you do not go back to the question or answer to any of the questions I asked and you grade B without any follow-up or explanation or possibility for the expert to clarify further. Since you are apparently new here, I would like to kindly remind you of the EE guidelines and the 10pts must system.

    Author Comment

    Sorry guys..
    I am new to this site.... I have read the grading guidelines...
    Thanks for your suggetions......

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now