Hello,
I am working with the 2008 Q2 version of the Rad Controls and try to fix the problem, that only one special button starting the progress manager and therefore the update.
I have different other buttons on my page, doing a full postback. When I press any of them the progressmanager starts. I tried your solution at http://www.telerik.com/community/forums/aspnet-ajax/upload/create-a-dedicated-submit-button-for-rad-upload.aspx
but it does not work. So I checked the __EVENTARGUMENT so that only the link button is allowed. But even with setting the input boxes to cleared, It does not work. The progressmanager still starts.
I even tried to set the ProgressManager to RegisterForSubmit and then calling for the onclick event of the upload button the StartProgressPolling. Trying this the progressmanager does not start at all.
Any ideas, how to solve the problem, that the ProgressManager (and the upload) start only pn the specified button?
I am working with the 2008 Q2 version of the Rad Controls and try to fix the problem, that only one special button starting the progress manager and therefore the update.
I have different other buttons on my page, doing a full postback. When I press any of them the progressmanager starts. I tried your solution at http://www.telerik.com/community/forums/aspnet-ajax/upload/create-a-dedicated-submit-button-for-rad-upload.aspx
but it does not work. So I checked the __EVENTARGUMENT so that only the link button is allowed. But even with setting the input boxes to cleared, It does not work. The progressmanager still starts.
function startUploadSubmit(sender, args, uploadID, labelID) { |
var upload = $find(uploadID); |
//make sure, that there will be no problem |
var eventTarget = document.getElementById('__EVENTTARGET'); |
if (eventTarget.value == '<%= btnUploadFile.UniqueID %>') { } |
else { |
var fileInputs = upload.getFileInputs(); |
for (var i = 0; i < fileInputs.length; i++) { |
upload.clearFileInputAt(i); |
} |
return; |
} |
var lblMessageElement = $get(labelID); |
//is a file selected |
var files = upload.getFileInputs(); |
if (files[0].files.length == 0) { |
args.set_cancel(true); |
lblMessageElement.innerHTML = '<%= Encoda.Web.Settings.GetLocalizedString("Dialog#NoFileSelected") %>'; |
return; |
} |
var valid = upload.validateExtensions(); |
if (!valid) { |
args.set_cancel(true); |
lblMessageElement.innerHTML = '<%= Encoda.Web.Settings.GetLocalizedString("Dialog#WrongFileExtension") %>'; |
return; WrongFileExtension |
} |
} |
I even tried to set the ProgressManager to RegisterForSubmit and then calling for the onclick event of the upload button the StartProgressPolling. Trying this the progressmanager does not start at all.
<telerik:RadScriptBlock runat="server"> <script language="javascript" type="text/javascript"> function startFileUpload() { |
var progManager = getRadProgressManager(); |
RadProgressManager.StartProgressPolling(); |
} |
</script> </telerik:RadScriptBlock> |
<telerik:RadProgressManager ID="progressManager" runat="server" OnClientSubmitting="startUploadSubmit" RegisterForSubmit="false" /> |
<ucc:EncodaLinkButton Runat="server" ID="btnUploadFile" Caption="Dialog#StartUpload" OnClick="btnUploadFile_OnClick" OnClientClick="startFileUpload();" /> |
Any ideas, how to solve the problem, that the ProgressManager (and the upload) start only pn the specified button?