出于某种原因,当尝试调用__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','');
工作正常。
有什么想法吗?
答案 0 :(得分:0)
虽然我认为它不那么简单,但我还是使用了一种解决方法。
$('#CPH_Body_buttonReset').click();