FileUpload Problem

2 posts, 0 answers
  1. Mahmoud
    Mahmoud avatar
    5 posts
    Member since:
    Sep 2010

    Posted 05 Mar 2011 Link to this post

    Hello ,

    I am working in a web application .. I am using RadTabStrip and RadMultiPage .. I added my controls to the RadMultiPage and added  all controls to RadAjaxManager like this

    uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadTabCompany);        uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadCompPages);

     Inside one of  the pageviews I put an asp FileUpload control

    <tr>
                    
                    <td valign="top" align="left" class="smallnormal">
                    Person Photo
                    </td>
                    <td valign="top" align="left" class="smallnormal">
                    
                    
                    <asp:FileUpload ID="uxFileUpload" runat="server" onclick="CheckThat_Click" CssClass="smallnormal"/>
     
                    <asp:Button ID="buttonUpload" runat="server" Text="Upload" CssClass="homebtn"   
                    style="width:70px;" onclick="CheckThat_Click" />
                    
                    
                    <asp:TextBox ID="uxTxtPicName" runat="server" Width="200px"></asp:TextBox>
                    </td>
                    
                    </tr>

    in cs file

    protected void CheckThat_Click(object sender, EventArgs e)
        {
             
            string mstr = uxFileUpload.FileName;
        }

    The problem is uxFileUpload.FileName is always nothing  if controls are added to the radajaxmanager

    I traced the problem
    When I comment lines that adding all controls to the RadAjaxManager like
    //uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadTabCompany);        //uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadCompPages);

    of course it does full postback and I can read the filename of the fileupload control without any problem
    when I re add the controls to the RadAjaxManager I always find the FileName is nothing

    I need to read the filename of the fileupload to insert it into the database in special field (person photo) then I can upload it to the server to be displayed correctly when someone choose this person

    I do not know what the problem
    I have to add the fileupload to the radajaxmanager ??


    what you advise me to do to solve the problem in this scenario ??
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 09 Mar 2011 Link to this post

    Hello Mahmoud,

    Note that the ajax should be disabled during upload. Please review the following online example for more information on uploading files with Ajax.

    Greetings,
    Maria Ilieva
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top