Results 1 to 4 of 4

Thread: Avoid Calling click event on pressing F5

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Avoid Calling click event on pressing F5

    Dear Buddy,
    I have V2 2005 Framework 2.0, On a web page I have TextBox, few Buttons on it, on click of a button some action happened, later on pressing F5 from keyboard , same button click event gets called, to avoid that I had changed to EnableViewState= false but my purpose didn’t served, button click event still get called.
    I want to know, how to stop calling button click event on pressing of F5 button.

    please help..

    Thanks & Regards,
    PPCC

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Avoid Calling click event on pressing F5

    Hey,

    One way to prevent this would be to redirect to another page once the work has been done in the Button Click event.

    Another method would be to add a variable to the ViewState of the button to show that you have already clicked it, and inspect that ViewState in the click event.

    Hope that helps!!

    Gary

  3. #3
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Re: Avoid Calling click event on pressing F5


  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Avoid Calling click event on pressing F5

    Quote Originally Posted by dnanetwork View Post
    Hey,

    How exactly does that help?

    That example is for a Windows Form Application?!?

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width