Web.zipI am working on the module that does upload data, without storing file on the server, in the WebForm environment utilizing WebUpload control. In general it is working..
Have several questions:1.I am getting texts on the buttons as following : after load I see "Upload File" then "Upload" and after it done - "Add" .... How do I change text on them ?
2. I added <div id="uploadErrors" style="color: red;"></div> and <AllowedExtensions>, when I am trying to add file with wrong extension it does not show upload button but it does not show error message in red either.. How to make message visible
3. How to make Clear Upload button visible.
4. In the document on the site there is following example adding server events :
<system.web><pages><add tagPrefix="igjq" namespace="Infragistics.Web.UI.EditorControls"assembly="Infragistics.Web.jQuery"/></pages></system.web><igjq:WebUpload ID="webUpload1" runat="server"OnUploadFinishing="webUpload1_OnUploadFinishing"OnUploadFinished="webUpload1_OnUploadFinished"OnUploadStarting="webUpload1_OnUploadStarting"></igjq:WebUpload>
On the other hand I just added protected void WebUpload1_UploadFinishing(object sender, Infragistics.Web.UI.EditorControls.UploadFinishingEventArgs e) and it is working, what is the difference ?
Files added for references, please show fixes in FileUpload01when possible...
Hello Michael,
It looks like there is some issue with the FileUploading event and it fires twice. You can workaround that by using a boolean var that shows if you've already handled it for this cycle like this:
var uploadingFlag = false; function WebUpload1_FileUploading(eventArgs, infoObject) { if (uploadingFlag) { uploadingFlag = false; return; } uploadingFlag = true; if (!confirm("Continue will override existing data")) { return false; } }
I've logged the issue in our internal system with ID 272025 and created a private support case on your behalf - CAS-210596-J0S1Y5. I've linked the issue with your case so that you will receive updates about its development.
Regarding the second question - there are icons in these places. My assumption is that they are not available because you are missing some part of the css folder structure. Please, ensure that you've copied the entire C:\Program Files (x86)\Infragistics\2020.1\ASP.NET\jQuery\css directory to the directory you are referring in your app.
As for the progress updates - you've already defined a http handler in your web.config so you may add it as a progress URL - ProgressUrl="/WebUploadStatusHandler.ashx". Please, check if that solves the issue.
I hope this helps! Please, let me know if I may help you further!
Best regards,
Stamen Stoychev
Hi Monika,
Couple more of them...
1. I need add warning that data will be overridden.. so I added WebUpload1_FileUploading like that:
function WebUpload1_FileUploading(eventArgs, infoObject) { if (confirm("Continue will override existing data")) return true; else return false
}
The issue is if I choose cancel, it does cancel - so it works fine.. but it I choose 'OK' means continue, it asks again and only after second 'OK' continue with upload.. why is that.. one 'ok' should be enough
2. Multiple files approach for clear button make things awkward.. so I noticed that even in single file case it has the little square on the upper right corner that actually has tool tip 'cancel' -- any way to add little 'x' sign to that.. (see the image)
3. Is there a way to make progress bar to move slower.. and/or controls it somehow..
Thanks.
FileUpload01.aspx.zip
The error message is being displayed because the file is not fully uploaded when the server tries to redirect. However, by binding a method to the client side fileUploaded event, as stated in your latest response, the file is already loaded and the page could be redirected.
Regarding your second question, the new value of the hidden input could be sent to the client side using the event server message. This could be achieved as follows:
protected void WebUpload1_UploadFinished(object sender, Infragistics.Web.UI.EditorControls.UploadFinishedEventArgs e)
{
e.ServerMessage += "">localhost:50313/Default2.aspx";
function fileUploaded(sender, args) {
$("#hdnSiteRootUrl").val(args.fileInfo.serverMessage);
var loc = $("#hdnSiteRootUrl").val();
window.location.replace(loc);
Please test it on your side and let me know if you need any further information regarding this matter.
Please note that due to the upcoming Christmas holidays you may experience slight delay in support responses.
Thank you for your understanding!
Regards, Monika Kirkova, Infragistics
And also while trying to gain more understanding how control works and what options are :
if I add event :
function WebUpload1_FileUploaded(eventArgs, infoObject){ //Add code to handle your event here. var loc = $("#hdnSiteRootUrl").val(); alert(loc); window.location.replace(loc);}
it will redirect to the next page.. the only thing I want to understand is the following.. if I assign value to the hidden variable during some page lifecycle events e.g. Page_Load (hdnSiteRootUrl.Value = "https://localhost:44319/Uno.aspx";) - it will work, if I would assign value to the hdnSiteRootUrl in WebUpload1_UploadFinishing or WebUpload1_UploadFinished then in WebUpload1_FileUploaded hdnSiteRootUrl will be "Original" i.e. initial value .. I wonder why...
<input id="hdnSiteRootUrl" runat="server" type="hidden" value="Original" />
Also Server.Transfer is a preferred way as I'll be reading some XML data stored in the first page with the upload control...