File Upload using RadAjaxPanel, RadAjaxLodingPanel and RadAjaxManager

8 posts, 0 answers
  1. Jessie
    Jessie avatar
    26 posts
    Member since:
    Mar 2009

    Posted 10 Sep 2009 Link to this post

    Hi, 

    I'm using RadUpload to upload the photo. 

    After I selected the photo and click the Upload Button, I want to refresh the image in DataList only by using RadAjaxPanel, RadAjaxLodingPanel and RadAjaxManager.  

    I don't want the whole page doing the postback. How can i do that? 

     

     

     

    <telerik:RadUpload ID="uplPhoto" runat="server" ControlObjectsVisibility="None" MaxFileInputsCount="1" > 
            </telerik:RadUpload> 
              
            <asp:Button ID="btnUpload" runat="server" Text="Upload" onclick="btnUpload_Click" /> 
     
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
            <asp:DataList ID="dtlPhoto" runat="server" DataKeyField="CreatedBy"   
                DataSourceID="odsPhoto" RepeatDirection="Horizontal" RepeatColumns="3"   
                onitemdatabound="dtlBlogPhoto_ItemDataBound">  
                <ItemTemplate> 
                    <img id="img1" alt="" src='<%# Eval("Location") %>' /> 
                </ItemTemplate> 
            </asp:DataList> 
            </telerik:RadAjaxPanel> 
     
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="btnUpload">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="dtlPhoto"   
                                LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManagerProxy> 
              
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">  
            </telerik:RadAjaxLoadingPanel> 

     

    Thanks.

    Regards,
    Jessie

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 10 Sep 2009 Link to this post

    Hi Jessie,

    We highly recommend avoid working with the RadAjaxManager & RadAjaxPanel controls at the same time. Use the controls depending on your exact scenario as recommended here.
    Additional information is available here:
    Ajaxifying controls wrapped in RadAjaxPanel and added to AJAX Manager settings

    Regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jessie
    Jessie avatar
    26 posts
    Member since:
    Mar 2009

    Posted 10 Sep 2009 Link to this post

    Hi Pavlina,

    Thanks for your reply.

    I had tried yr recommendation(as below) but it still will refresh the whole page. I just want to refresh the DataList only after click the Upload button. Thanks.

    <telerik:RadUpload ID="uplPhoto" runat="server" ControlObjectsVisibility="None" MaxFileInputsCount="1">  
    </telerik:RadUpload> 
     
    <asp:Panel ID="Panel1" runat="server">  
    <asp:Button ID="btnUpload" runat="server" Text="Upload" onclick="btnUpload_Click" /> 
    </asp:Panel> 
     
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="btnUpload">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="dtlPhoto"   
                                LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManagerProxy> 
     
     
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 10 Sep 2009 Link to this post

    Hi Jessie,

    Please replace RadAjaxManagerProxy with RadAjaxManager control and let me know if it works properly.
    I hope this helps to achieve the desired functionality.
     
    Greetings,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Jessie
    Jessie avatar
    26 posts
    Member since:
    Mar 2009

    Posted 10 Sep 2009 Link to this post

    Hi Pavlina,

    Thanks for your help.

    I just replace RadAjaxManagerProxy with RadAjaxManager control and then wrap my JavaScript code in RadCodeBlock  but I still have 1 problem.

    When I select the photo and click Upload button, the uplPhoto.UploadedFiles.Count become 0.

     

    <telerik:RadUpload ID="uplPhoto" runat="server" ControlObjectsVisibility="None" MaxFileInputsCount="1">     
    </telerik:RadUpload>    
          
    <asp:Button ID="btnUpload" runat="server" Text="Upload" onclick="btnUpload_Click" />    
       
        
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">     
                <AjaxSettings>    
                    <telerik:AjaxSetting AjaxControlID="btnUpload">     
                        <UpdatedControls>    
                            <telerik:AjaxUpdatedControl ControlID="dtlPhoto"      
                                LoadingPanelID="RadAjaxLoadingPanel1" />    
                        </UpdatedControls>    
                    </telerik:AjaxSetting>    
                </AjaxSettings>    
            </telerik:RadAjaxManager>    
        
     
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 11 Sep 2009 Link to this post

    Hi Jessie,

    If the issue persists, I will ask you to open a formal support ticket and supply a small project, demonstrating this erroneous behavior, for additional testing and review.

    Kind regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Jaya
    Jaya avatar
    81 posts
    Member since:
    Mar 2011

    Posted 15 Oct 2014 in reply to Pavlina Link to this post

    Hi
    Pavlina's

    How to use radupload with radajaxpanel without Postback any one Guide me. I am new in Telerik Controls
  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 20 Oct 2014 Link to this post

    Hello,
    RadUpload cannot upload files using AJAX calls. This is a limitation of the XmlHttpRequest component, used in all AJAX frameworks for asynchronous calls to the application. In order to upload a file your application must perform a full page postback. You cannot use AJAX behavior while uploading files. For more information on the subject you can refer to the article below:
    http://www.telerik.com/help/aspnet-ajax/upload-uploading-ajax.html


    Regards,
    Pavlina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017