I have a Master Page implemented form, with a RadAjaxPanel and RadAjaxLoadingPanel defined in the Master Page. On the Web Form, I have a RadUpload, and an button to initiate the upload. I've seen a number of examples on doing uploads using various combinations of these, but not all three as described above. Is there an example of how to do this?
I had this working using AjaxPanel, and you simply added the control to the Trigger collection as a postback trigger. I'm looking for something analagous to this.
Steve
6 Answers, 1 is accepted
To see more information along the lines of the requested functionality, please refer to the following example.
Review the code, and see how it meets your requirements.
All the best,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
function conditionalPostback(e, sender)
{
var theYearbookRegexp = new RegExp("\.btnUploadPhoto$|\.btnUploadPhoto$", "ig");
var theLockerRegexp = new RegExp("\.uploadLockerPic$|\.uploadLockerPic$", "ig");
if (sender.get_eventTarget().match(theYearbookRegexp))
{
var upload = $find(window['radUpload']);
//AJAX is disabled only if file is selected for upload
if(upload.getFileInputs()[0].value != "")
{
sender.set_enableAjax(
false);
}
}
if (sender.get_eventTarget().match(theLockerRegexp)) {
var upload = $find(window['radUpload']);
//AJAX is disabled only if file is selected for upload
if (upload.getFileInputs()[0].value != "") {
sender.set_enableAjax(
false);
}
}
}
<
telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" clientevents-onrequeststart="conditionalPostback">
I checked my uploads, those are the correct names
var upload = $find(window['rbUpload']);
------------------------------------------------------------------------------
<
script type="text/javascript">
<telerik:radscriptblock id=
"RadScriptBlock1" runat="server">
function conditionalPostback(e, sender)
{
var theYearbookRegexp = new RegExp("\.btnUploadPhoto$|\.btnUploadPhoto$", "ig");
var theLockerRegexp = new RegExp("\.uploadLockerPic$|\.uploadLockerPic$", "ig");
if (sender.get_eventTarget().match(theYearbookRegexp))
{
var upload = $find(window['rbUpload']);
//AJAX is disabled only if file is selected for upload
if(upload.getFileInputs()[0].value != "")
{
sender.set_enableAjax(
false);
}
}
if (sender.get_eventTarget().match(theLockerRegexp)) {
var upload = $find(window['uploadLockerPic']);
//AJAX is disabled only if file is selected for upload
if (upload.getFileInputs()[0].value != "") {
sender.set_enableAjax(
false);
}
}
}
</telerik:radscriptblock>
</script>
Thanks
Steve
The provided code does not give enough information for the error you are facing and what exactly is causing it. Could i kindly ask you to open a regular support ticket and send us runnable version of your application. Thus we will be able to debug it locally and isolate the root cause of the issue you are facing.
Kind regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
The provided code does not give enough information for the error you are facing and what exactly is causing it. Could i kindly ask you to open a regular support ticket and send us runnable version of your application. Thus we will be able to debug it locally and isolate the root cause of the issue you are facing.
Kind regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.