1

何らかの理由で、__doPostBack を呼び出して jQuery イベント内から UpdatePanel を更新しようとすると、ページが単に更新されます。

次のコードが実行されると、さらに掘り下げます。

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

Firebug(または同様のもの)を見ると、ページが更新される直前に次のようになります。

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

それでも、Chrome または Firebug でコンソールを使用して実行する場合

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

それは正常に動作します。

何か案は?

4

1 に答える 1

0

「そんなに」簡単だとは思いませんでしたが、回避策を使用しました。

$('#CPH_Body_buttonReset').click();
于 2011-12-08T16:32:45.983 に答える