问题描述
我有一个的.aspx
A 按钮
页面,该页面打开弹出
到上传图片
选定的项目。
I have a button
on a .aspx
page which opens the popup
to upload images
of selected item.
ListEdit.aspx
<asp:Button ID="btnListingImageUpload" runat="server" Text="Upload Images"
OnClientClick="basicPopup()"/>
JavaScript的:
function basicPopup() {
var QuoteId = document.getElementById('<%= hdnQuoteIDForListing.ClientID%>').value;
var IsPrep = document.getElementById('<%= hdnIsPrep.ClientID%>').value;
alert(IsPrep);
popupWindow = window.showModalDialog('ListingImageUpload.aspx?QuoteID=' + QuoteId + '&IsPrep=' + IsPrep, 'popUpWindow', 'height=400,width=600,left=200,top=250,resizable=0');
return false;
}
AjaxFileUpload控制弹出页在
<cc1:AjaxFileUpload ID="AjaxFileUpload2" ThrobberID="myThrobber" ContextKeys="fred" AllowedFileTypes="jpg,jpeg" MaximumNumberOfFiles="10" runat="server" OnUploadComplete="AjaxFileUpload1_UploadComplete1"
OnClientUploadComplete =onClientUploadCompleteFront/>
OnClientUploadComplete="onClientUploadCompleteFront" />
当我点击
在按钮
它打开页
含在弹出的页面 AJAXFileUpload
控制和查询字符串
弹出。当我点击弹出页面中包含 AjaxFileUpload
的上传按钮,控制它提供了以下错误:
When i click
on button
it opens the page
as popup containing AJAXFileUpload
control and querystring
in popup page. When i click on 'Upload' button of popup page containing AjaxFileUpload
control it gives following error:
JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data
但是,如果是查询字符串,它工作正常使用的会话,而不是!
我用Google搜索,发现的 此链接 ,但我不能够解决它。我有 AJAXControlToolKit.dll
(只)在 bin文件夹
,而不是源文件和其他二进制文件。
I have googled and found this link but i am not able to resolve it. I have AJAXControlToolKit.dll
(only)in bin folder
and not the source files and other binaries.
注意: 请建议的解决方案使用查询字符串
只。原因是,这个弹出的多个实例将在同时打开。因此,不能使用会话
变量。的
NOTE: Please suggest solution using querystring
only. Reason is, multiple instances of this popup will open at time. So, cant use Session
variables.
帮助鸭preciated!
Help Appreciated!
推荐答案
这是一个已知的问题,当AjaxFileUpload回来后它需要你的网页的URL和追加到它的结束它的own.query字符串(contextkey和GUID)。这工作得很好,如果你的页面的URL不包含任何查询字符串,但如果是的话,那么你最终得到一个包含两个问号这将会破坏最后的查询字符串值,这反过来从工作停止上传的URL。
This is a known issue, when AjaxFileUpload post back it takes your page URL and appends onto the end of it it's own.query strings (contextkey and guid). This works fine if your page URL doesn't already contain any query strings butif it does then you end up with a URL that contains two question marks which will corrupt your final query string value and this in turn stops the upload from working.
勾选此已知问题
这篇关于AjaxFileUpload当页面有查询字符串在asp.net控制不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!