Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setTimeout in select box change event

Tags:

asp.net

When I have autopostback set to true on a select box, why is the 'setTimeout' necessary in the onchange event? Why isn't __doPostBack just called directly?

onchange="javascript:setTimeout('__doPostBack(\'ctl00$myselect\',\'\')', 0)" 
like image 856
mike Avatar asked Oct 15 '22 08:10

mike


1 Answers

From MSDN:

The JavaScript setTimeout method is used with the _doPostBack method to ensure that the user action completes before the postback occurs.

like image 128
dugas Avatar answered Oct 19 '22 03:10

dugas