locked
Avoiding button click event when page refreshed does not work in my environment RRS feed

  • Question

  • User-597672045 posted

    Here is the thread where the issue was raised, and here is the linked solution.

    When I implement this in an isolated environment (new website in Visual Studio only with one aspx page) it works. 

    What I have noticed is when I step through code is that when the page is refreshed, Page_PreRender does seem to execute when the page is refreshed, but ViewState is not updated.  So the debugger does step through the code, but ViewState["update'] does not change (even though in the immediate window, ViewState appears to change, but it doesn't).

    void Page_PreRender(object obj,EventArgs e)
    {
        ViewState["update"] = Session["update"];
    }

    In my application, the above solution simply does not work.  In my application, ViewState["update"] DOES change in Page_PreRender.  

    Friday, October 19, 2018 6:51 PM

All replies