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

FileUpload Problem

1 Answer 59 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mahmoud
Top achievements
Rank 1
Mahmoud asked on 05 Mar 2011, 08:10 AM
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 ??

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 09 Mar 2011, 02:26 PM
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!
Tags
Ajax
Asked by
Mahmoud
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or