Delaying autopostbacks on dropdownlists

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
 
B

bruce barker

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top