This is a migrated thread and some comments may be shown as answers.

[Solved] Upload and RadAjaxManager/RadAjaxManagerProxy

8 Answers 310 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 13 Feb 2009, 05:30 PM

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

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 16 Feb 2009, 09:21 AM
Hi Jim,

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.
0
Jim
Top achievements
Rank 1
answered on 16 Feb 2009, 03:40 PM

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!

 

0
Veselin Vasilev
Telerik team
answered on 19 Feb 2009, 03:43 PM
Hello Jim,

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.
0
Markus
Top achievements
Rank 1
answered on 14 Apr 2009, 02:51 PM
Hi Veselin

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  
 
Then i removed the masterpage and add the neccessary code into the content-page (now a normal aspx-page), and the uploadedFile.Count shows > 0 afterwards  => It works without Masterpage.

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 
[There was no need for an "OnRequestStartHandler"]

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
0
Veselin Vasilev
Telerik team
answered on 15 Apr 2009, 09:05 AM
Hello Markus Ruf,

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.
0
Markus
Top achievements
Rank 1
answered on 15 Apr 2009, 11:32 AM
Hi Veselin

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)
Hi Jan,

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
0
Veselin Vasilev
Telerik team
answered on 17 Apr 2009, 03:04 PM
Hello Markus Ruf,

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.
0
Markus
Top achievements
Rank 1
answered on 20 Apr 2009, 11:28 AM
Hi Veselin

Ok, thanks.

Regards
Markus
Tags
Upload (Obsolete)
Asked by
Jim
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Jim
Top achievements
Rank 1
Markus
Top achievements
Rank 1
Share this question
or