Would someone please post an example of using RadUpload within a Master Page using a RadAjaxManager, on a content page with RadAjaxManagerProxy.
I have seen the threads dealing with setting the RadAjaxManager.ClientEvents-OnRequestStart property. But it does not address doing this with RadAjaxManager.
Currently, I can get RadUpload to work if I remove the entire RadAjaxManagerProxy structure from the content page. This is not acceptable, because my project specs require ajax functionality. It would be OK to disable ajax and do a full page postback if the request contains an upload.
8 Answers, 1 is accepted
Please find attached a sample project. It uses master page with RadAjaxManager on it, content page with RadUpload and RadAjaxManagerProxy and a button.
I hope you will find it useful.
Best wishes,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you Veselin, that got me along the right path.
In my case, I have a requirement to do dynamic forms, so I didn't know the name of the control, or even if the form contained an upload control. So here's what my javascript looks like to handle this:
// my form submit button is named "btnFormSave" -- it's not dynamic.
if (e.get_eventTarget().match(/btnFormSave$/, 'ig'))
{
for (var i = 0; i < e._eventTargetElement.form.elements.length; i++)
{
// if form contains an upload control, must disable ajax if there's a file specified.
if (
(e._eventTargetElement.form.elements[i].type == 'file') &&
(e._eventTargetElement.form.elements[i].title.length > 0)
)
{
e.set_enableAjax(false);
return;
}
}
}
I also noticed that if my content page didn't contain the javascript function as referenced in my RadAjaxManager on the master page, then the site would bomb out. So, I set my event handler on the content page rather than in the master page markup. The Page_load on the content page looks like:
protected void Page_Load(object sender, EventArgs e)
{
if (! IsPostBack)
{
RadAjaxManager j = (RadAjaxManager)Page.Master.FindControl("RadAjaxManager1");
j.ClientEvents.OnRequestStart = "onRequestStartHandler";
}
....
}
So now I can handle dynamic forms which may contain an upload control. If the control actually contains a file, then we disable the master page's AjaxManager. Works well so far. If you see anything wrong with this approach, please let me know.
Thanks for your time and consideration!
Your code looks ok. The only things that you can improve is: do not use private properties like _eventTargetElement. You can use the get_eventTargetElement() method of the event arguments.
More about OnRequestStart method here.
Greetings,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I had the same problem (Q1 2009.1.311.35). I implemented as suggested here.
But i still got a uploadedFiles.Count of 0.
The environment:
| Masterpage: |
| - RadAjaxManager |
| ContentPage: |
| - asp:Content |
| - Rad ProgressManager |
| - RadAjaxManagerProxy (with registering the UploadButton) |
| - RadAjaxLoadingPanel |
| - RadToolTipManager |
| - RadSplitter |
| - RadPane |
| - RadGrid |
| - /RadPane |
| - RadSplitBar |
| - RadPane |
| - asp:Panel |
| - table, tr, td with RadUpload and the UploadButton |
| - /asp:Panel |
| - /RadPane |
| - /RadSplitter |
| - RadScriptBlock for the "OnRequestStartHandler" |
| - /asp:Content |
I tried another test: Masterpage and Contentpage:
| Same Masterpage as described above |
| Contentpage: |
| - ProgressManager |
| - RadAjayManagerProxy (without registering the UploadButton) |
| - asp:Panel (table, tr, td with RadUpload and UploadButton) |
| - /aspPanel |
In this scenario RadUpload worked fine. Before i try out every scenario to get this thing working: Are there known issues about combinations of controls with RadUpload/Masterpage that don't work, or do i miss something?
Regards
Markus
I am afraid I cannot tell without first seeing the code and testing locally.
You can open a support ticket and attach your test pages there.
Thanks
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I thought, the question was not that difficult:
Which combination of controls can cause problems?
Yesterday, I found this thread:
Posted on May 20, 2008 (permalink)
Recently we found that scenarios with RadAjaxManager, RadTabStrip and RadMultiPage sometimes do not work properly. To my regret we could not find a proper design solution, which would cover all the usage scenarios. Anyways, we didn't give up - we're researching the problem and I hope we will be able to deliver a solution soon. Currently we suggest using RadAjaxPanel instead (as you've already found).
Kind regards,
Erjan Gavalji
the Telerik team
I just wanted to know: what other combinations (including RadUpload) does Telerik has knowledge of, that don't work properly together?
Regards,
Markus
We have described the known limitations here.
I am not aware of any other combinations.
Greetings,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Ok, thanks.
Regards
Markus