Results 1 to 25 of 25

Thread: How to prevent postback on button click.

Hybrid View

  1. #1
    New Member
    Join Date
    Oct 2011
    Posts
    1

    Re: How to prevent postback on button click.

    wow, 6 years and still active...

    Paul have you found a solution to your problem? I have the same question...

    I have a button whose code behind event I want fired when it's clicked on, but I don't want it to cause a postback... sounds strange (and someone illogical too, I appreciate that!), and there are possibly workarounds as well, but this is an interesting problem and I want to see if it can be resolved as is. anyone any ideas?

    Paul, in case nobody's got a bright idea, you may want to take a look at:
    http://ryanfarley.com/blog/archive/2005/03/11/1886.aspx

    it explains how to determine what control caused the postback and then get creative from there. But I still badly want this question answered!

    thanks for yout time.

  2. #2
    New Member
    Join Date
    Oct 2011
    Posts
    4

    Re: How to prevent postback on button click.

    The workaround I did, which is not a very efficient one, is based on the fact that postback situations do restore form controls to their pre-postback condition, so I created a bunch of hidden text boxes that contain all of my important variable values. It works, but isn't a very good way to do things.

    There has to be a way around this, otherwise, no user button operations would be allowed as it would cause postbacks and everything gets reset!!

    Something is missing in 1) how all of us are presenting the problem or 2) developers have set some properties that result in NOT getting the problem to begin with and they don't realize it so they can't help us.

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