AjaxFileUpload当页面有查询字符串在asp.net控制不工作字符串、页面、工作、AjaxFileUpload

2023-09-08 09:46:43 作者:旧颜已不复当年

我有一个的.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 but if 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.

勾选此已知问题

 
精彩推荐
图片推荐