Re: Delay AutoPostback?

Discussion in 'ASP .Net' started by Harv, Jul 21, 2010.

  1. Harv

    Harv Guest

    On Jul 15, 4:59 am, "Brian Cryer" <not.here@localhost> wrote:
    > I'm making considerable use of auto-postback and the page is responsive so
    > this works fine. I have found though there were I have a number of check
    > boxes even a 1 second postback "turn-around" can be annoying because it
    > gives me time to click on a second check box before the page has been
    > refreshed which means that I loose the effect of that second click. I know
    > the traditional approach would be to use a separate submit button and
    > abandon auto-postback, but I'd rather not do this because the only place I
    > can introduce a submit button would necessitate the user scrolling.
    >
    > Page design and layout issues aside, is there any (easy) way to delay an
    > auto-postback so its say 1 second after the last click or key-press?
    >
    > Thanks.
    > --
    >  Brian Cryer
    >  http://www.cryer.co.uk/brian


    Can you explain a little more on why you would want to delay a
    postback? What are you doing in the event handler of the checkbox? Are
    you displaying more information to the user upon return? If you might
    clarify what you are doing we might be able to assist in the "design"
    and offer other solutions...
     
    Harv, Jul 21, 2010
    #1
    1. Advertising

  2. Harv

    Harv Guest

    On Jul 22, 2:47 am, "Brian Cryer" <not.here@localhost> wrote:
    > "Harv" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On Jul 15, 4:59 am, "Brian Cryer" <not.here@localhost> wrote:
    > > > I'm making considerable use of auto-postback and the page is responsive
    > > > so
    > > > this works fine. I have found though there were I have a number of check
    > > > boxes even a 1 second postback "turn-around" can be annoying because it
    > > > gives me time to click on a second check box before the page has been
    > > > refreshed which means that I loose the effect of that second click. I
    > > > know
    > > > the traditional approach would be to use a separate submit button and
    > > > abandon auto-postback, but I'd rather not do this because the only place
    > > > I
    > > > can introduce a submit button would necessitate the user scrolling.

    >
    > > > Page design and layout issues aside, is there any (easy) way to delay an
    > > > auto-postback so its say 1 second after the last click or key-press?

    >
    > > > Thanks.
    > > > --
    > > > Brian Cryer
    > > >http://www.cryer.co.uk/brian

    >
    > > Can you explain a little more on why you would want to delay a
    > > postback? What are you doing in the event handler of the checkbox? Are
    > > you displaying more information to the user upon return? If you might
    > > clarify what you are doing we might be able to assist in the "design"
    > > and offer other solutions...

    >
    > I have a set of check boxes (not many, but anywhere between 4 and possibly
    > 16), each of which change some aspect of reported information shown in a
    > table and I regenerate/redisplay the table after each checkbox change. If a
    > user is quick in clicking the check boxes then they can check 2 or 3
    > checkboxes before the page has refreshed which means that it looks like of
    > the (say) 3 they had checked only 1 has stuck and the other two have reset.
    > (All done within an ajax panel, so I'm not updating the entire page.)
    >
    > I know the traditional approach is to stick a [submit] button on the page,
    > and I do that if JavaScript (and thus auto-postback) is disabled. But for
    > most people (who only click once or twice or do it more slowly) the current
    > approach works fine.
    >
    > Like I said in my original post, page design and layout issues aside, is
    > there any (easy) way to delay an auto-postback so its say 1 second after the
    > last click or key-press? I suppose the answer is no ... or perhaps I should
    > look at the javascript postback logic provided by the framework and see if I
    > could replace that by introducing a small timer ... although even if I do
    > that I suppose I'm just moving the point at which it becomes a problem, so
    > maybe what I'm after isn't an answer after all ... so thoughts welcome.
    > --
    >  Brian Cryer
    >  http://www.cryer.co.uk/brian


    Brian,

    I have done similar work on a survey so I understand your pain. There
    might be a couple of options available:

    1 - UpdateProgress to "lock" the page until the postback finishes.

    2 - Utilize some javascript to disable controls on the page. This
    might help if you want this route:
    http://dotnetslackers.com/community...n-after-click-event-_5B002E00_AJAX_5D00_.aspx.
    If course you would probably have to disable all the checkbox controls
    at once or maybe put them all in a single Panel and just enable/
    disable that.

    3 - Create a single control (ascx) with an update panel containing one
    of the checkbox controls and allow that object to handle it's own
    events per checkbox. Of course this means you create a control for
    each checkbox you are displaying but at least each control can handle
    the event individually and display additional information within
    itself.

    We ended up using #3 in the survey. It allowed each control to do its
    own processing and allowed the user to check a box and move on. We
    also added an update progress showing the user we are doing something
    with that response they provided... this actually helped a lot as the
    user understands the page is "doing" something.

    Attempting to "head off" the postback and make it wait isn't a good
    idea. You should be able to write controls that can respond
    individually through some type of asynchronous operations or force the
    user to wait for the process to finish before moving on. Of course the
    latter will not be acceptable to users as they never want to wait. =).
    I would look into the asynchronous triggers of the update panel of
    each individual control and see if that helps the user click as fast
    as they want and allows your data to load based on server load or
    response time.

    Anyway... not sure any of this helps but maybe sparked a solution for
    you.

    Mark
     
    Harv, Jul 22, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi

    Can NOt AutoPostBack for two DDL

    huobazi, Jul 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    510
    huobazi
    Jul 2, 2003
  2. huobazi
    Replies:
    1
    Views:
    716
    David Waz...
    Jul 3, 2003
  3. Mira Vizjak

    AutoPostBack

    Mira Vizjak, Jul 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    498
    Mira Vizjak
    Jul 14, 2003
  4. Jesse

    Problem with Autopostback

    Jesse, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    468
    Jesse
    Jul 17, 2003
  5. Domien Holthof

    AutoPostBack question.

    Domien Holthof, Jul 17, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    455
    Marina
    Jul 17, 2003
Loading...

Share This Page