Delaying autopostbacks on dropdownlists

  • Thread starter Thread starter daokfella
  • Start date Start date
D

daokfella

The onchange event fires when using the arrow keys in a dropdownlist.
Is it possible to delay the autopostback so I can allow users to use
the arrow keys on a dropdownlist with autopostback set to "true"
without it posting back on every single arrow press? I see that the
_DoPostBack is used with a setTimeout using 0 as the number of
milliseconds. Is it possible to tweak this value?

Jason
 
it would not help. if you down arrowed thru 5 items, you'd queue up 5
postbacks. the settimeout is just to do the postback on the next windowloop,
so that controls will postback the correct values.

you should not use autopostback with a dropdown due to this behavior, and
never make the dropdown a trigger for an update panel (may work fine on your
local dev box, but you users will have problems).

you could add you own client code that started a postback timer, that is
reset by every onchange.

if you do use autopostback (or simular), you should disable the dropdown at
postback so that the user does not start another postback, or try to change
the value during postback and rerender. the postback should also render the
dropdown disabled, and enable it with client code using the client side
onload event.

-- bruce (sqlwork.com)
 
Back
Top