因为项目需要,在上传文件的时候,临时使用了Jeffrey Zhao写的AjaxFileUploadHelper控件。
但是在使用 的过程中遇到了这样的问题:
在页面中使用了 IETreeView 控件发生这个错误的,但是在我建立的测试项目中发生的是500错
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
找了半天也不知道是什么原因。给其发了2个邮件,也不见丝毫回应.....
只好查源代码:发现在其写的控件中有一个Page_Error函数被触发。
private
void
EnsureIsInAjaxFileUploading()
{
this.isInAjaxUploading = AjaxFileUploadUtility.IsInIFrameAsyncPostBack(this.Page.Request.Params);
//this.Page.Error += new EventHandler(Page_Error);
if (this.isInAjaxUploading)
{
isInAsyncPostBackFieldInfo.SetValue(
ScriptManager.GetCurrent(this.Page),
true);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.Page.Error += new EventHandler(Page_Error);
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
private
void
Page_Error(
object
sender, EventArgs e)
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AjaxFileUploadUtility.WriteScriptBlock(this.Page.Response, true);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
onPageErrorMethodInfo.Invoke(this.PageRequestManager, new object[] ...{ sender, e });
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
AjaxFileUploadUtility.WriteScriptBlock(this.Page.Response, false);
}
可是还是解决不了问题。
于是在原来的页面下.aspx的cs文件中增加了一个函数
protected
void
Page_Error(
object
sender, EventArgs e)
{
Exception ex = Server.GetLastError();
Server.ClearError();
}
截获了Exception。发现因为Exception的存在影响了老赵控件的作用。
将整个Exception解除之后,UploadHelper控件正常工作
但是在使用 的过程中遇到了这样的问题:
在页面中使用了 IETreeView 控件发生这个错误的,但是在我建立的测试项目中发生的是500错
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
找了半天也不知道是什么原因。给其发了2个邮件,也不见丝毫回应.....
只好查源代码:发现在其写的控件中有一个Page_Error函数被触发。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
可是还是解决不了问题。
于是在原来的页面下.aspx的cs文件中增加了一个函数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
截获了Exception。发现因为Exception的存在影响了老赵控件的作用。
将整个Exception解除之后,UploadHelper控件正常工作