Ajax工具包AjaxFileUpload抛出异常 [英] Ajax Toolkit AjaxFileUpload throw exception
问题描述
我有我想补充我加了一个工具包,脚本经理母版页的文件上传报名表
然后我添加了一个ajaxfileupload控制<$c$c><http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx>$c$c>
在ASPX看起来像这样
&LT; ajaxToolkit:AjaxFileUpload ID =AjaxFileUpload1ThrobberID =myThrobberContextKeys =弗雷德
AllowedFileTypes =JPG,JPEGMaximumNumberOfFiles =2=服务器UploadedComplete =AjaxFileUpload1_UploadedComplete/&GT;
方法AjaxFileUpload1_UploadedComplete是空的现在。
我得到这个例外,没有事件被触发,除了在Page_Load
Sys.ArgumentException:Sys.ArgumentException:无法反序列化。该
数据不对应于有效的JSON
块引用>解决方案我意识到这是一个老问题,但我认为这是由控制错误造成的。追加查询字符串参数,但假定没有现有的参数。
有细节,这里修复: HTTPS://ajaxcontroltoolkit.$c$cplex。 COM /工作项目/ 27149 (涉及更改源和重建工具包)
I have an entry form which I want to add a file uploader I added a toolkit script manager to the master page then i added an ajaxfileupload control
<http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx>
the aspx looks like this
<ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" ThrobberID="myThrobber" ContextKeys="fred" AllowedFileTypes="jpg,jpeg" MaximumNumberOfFiles="2" runat="server" UploadedComplete="AjaxFileUpload1_UploadedComplete" />
the method AjaxFileUpload1_UploadedComplete is empty for now.
I got this exception and no event is firing except for the page_load
Sys.ArgumentException: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
解决方案I realise this is an old question but i think this is caused by a 'bug' in the control. It appends query string parameters but assumes there are no existing parameters.
There are details and a fix here: https://ajaxcontroltoolkit.codeplex.com/workitem/27149 (involves changing the source and rebuilding the toolkit)
这篇关于Ajax工具包AjaxFileUpload抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!