本文转自:http://*.com/questions/2083929/dropdownlist-doesnt-postback-after-page-clientvalidate
Update: I have just found the solution. The following function works (remove the else part):
But I am wondering why it doesn't work when I add the else part. Question: I want to have a confirm dialog after user fills in all the data in the form. I set onclientclick="return confirmSubmit()" in the submit button.
If Page_ClientValidate("Group1") returns false, the dropdownlist doesn't cause postback after I first select the item, and the postback only occurs when I select the dropdownlist second time. What's the problem? |
|||||||||
|
8
|
After Page_ClientValidate is called, the variable Page_BlockSubmit gets set to true, which blocks the autopost back. Page_BlockSubmit was getting reset to false on the second click, for what reasons I still don't fully understand. I'm looking more into this, but I have a solution and I'm under the gun so I'm rolling with it.... Just add below code in the code block which executes if Page is not valid.
e.g.
|