upload control not working with update panel

Last post 10-02-2009 2:35 AM by Vince Xu - MSFT. 3 replies.

Sort Posts:

  • upload control not working with update panel

    09-29-2009, 12:22 PM
    • Member
      point Member
    • naveenforum
    • Member since 09-06-2009, 4:55 AM
    • Posts 4
    Hi,

    I am working with Asp.Net FileUpload control with ajax update panel,

    if i use the AsyncPostBackTrigger,i am unable to get the filename in serverside,
    but if i use PostBackTrigger its working fine with page refreshing

    my Html code is:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:FileUpload ID="FileUpload1" runat="server" />
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </ContentTemplate>
    <Triggers>
    <asp:PostBackTrigger ControlID="Button1" />
    </Triggers>

    I dont want to refresh page while uploading file

    please help me regarding same.
     
    Thanks,
    Naveen G

     

  • Re: upload control not working with update panel

    09-29-2009, 12:46 PM
    Answer
    • All-Star
      30,500 point All-Star
    • HeartattacK
    • Member since 01-08-2007, 5:53 PM
    • Dhaka, Bangladesh
    • Posts 3,292
    • Moderator
      TrustedFriends-MVPs

     Files CAN'T be uploaded on an AJAX request. This is not limited to asp.net or asp.net AJAX or the toolkit. Here's a video about a trick to simulate an upload via AJAX:

    http://www.asp.net/learn/videos/video-254.aspx

    All that glitters is gold-
    Only shooting stars break the mold.

    Read my blog: www.heartysoft.com

    Tell me what tutorials / articles / videos you want to see on my site.
  • Re: upload control not working with update panel

    09-29-2009, 12:47 PM
    Answer
    • Star
      8,667 point Star
    • Pawan_Mishra
    • Member since 03-13-2008, 11:37 AM
    • Bangalore
    • Posts 1,266

    Hello

    Unfortunately FileUpload without full page postback is not possible.Yes there are alternatives like using IFrames etc but they are far too cumbersome.Sometimes its better to live with little bit of full page postback and specially when if it makes ur life easy.

    Remember keep simple things simple :) ......

    Regards
    Pawan Mishra

    Too many eyes doesn't make a good code !!!

    .Net 360°
  • Re: upload control not working with update panel

    10-02-2009, 2:35 AM
    Answer

    Hi,

    Fileupload is not worked with updatepanel. Ajaxcontroltoolkit 30930 just has been published. Please use AsyncFileUpload to achieve it.

    http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)