PageRequestManagerServerErrorException when __doPostBack from within jQuery event, but not from console?

StackOverflow https://stackoverflow.com/questions/8434209

Question

For some reason, when trying to call __doPostBack to update my UpdatePanel from within a jQuery event, the page simply refreshes.

Delving deeper, when the following code is executed:

$('#modal-forgottenpassword .modal-close').live('click', function(e)
{
    e.preventDefault();   
    $('#modal-forgottenpassword input[type=hidden]').val('0');   
    __doPostBack('ctl00$CPH_Body$buttonReset','');  
});

and looking at Firebug (or similar), I get the following just before the page refreshes:

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0

Yet, if I were to use the console in Chrome or Firebug and execute

__doPostBack('ctl00$CPH_Body$buttonReset','');

It works fine.

Any idea's?

Was it helpful?

Solution

Although I didn't think it was "that" simple, I used a work around.

$('#CPH_Body_buttonReset').click();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top