在用asp.net ajax出现如下错误时:
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. the status code returned from the server was:500
解决方法1,在.aspx文件中加上 ValidateRequest="false"
解决方法2,
这时候大家可以在web.config的system.web节中加入
<customErrors mode="Off"/>
解决方法3,
页面底部加上:
<script language="javascript" type="text/javascript">
Sys.Application.add_load(
function()
{
var form = Sys.WebForms.PageRequestManager.getInstance()._form;
form._initialAction = form.action = window.location.href;
}
);
</script>