Specified argument was out of the range of valid values. 解决方法
Posted on 2010-07-23 13:48 宽田 阅读(4489) 评论(0) 编辑 收藏 举报今天用updatePanel总是遇到些奇怪的问题。刚刚就碰到下边问题。
Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values.
详细问题描述如下:
代码
Specified argument was out of the range of valid values.
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Source Error:
An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.]
Microsoft.Reporting.WebForms.ReportViewer.set_CurrentPage(Int32 value) +118
Microsoft.Reporting.WebForms.ReportViewer.ClientSidePageNumberChanged(Object sender, EventArgs e) +97
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Source Error:
An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.]
Microsoft.Reporting.WebForms.ReportViewer.set_CurrentPage(Int32 value) +118
Microsoft.Reporting.WebForms.ReportViewer.ClientSidePageNumberChanged(Object sender, EventArgs e) +97
出现上边的问题是因为我在报表页面中套用了Master页面。Master页面中使用Ajax的Timer做定时取资料功能。页面运行正常,Timer第一次取资料正常,当第二次取资时出现上面的错误。
上面的错误是由ReportViewer引起,可以不知道为什么。查了些资料找到了解决方法。
解决方法:
先将 ReportViewer的visiable设为False,当取到资料后,在将eportViewer的visiable设为True即可。
参考解决方法页面: