FileUpload is not working in UpdatePanel

Posted on 2007-08-02
Last Modified: 2013-11-19
I'm using the FileUpload in UpdatePanel of Ajax extension, but its not working. any idea what to do with it to get the problem solve?
Question by:apnamian
    LVL 9

    Accepted Solution

    Well ,FileUpload does not work with Update Panel. I tried other ways but ended up keeping it outside the update panel. You can refer to this forums link if you want to experiment.
    LVL 2

    Expert Comment

    Actually it can be done, as long as you use triggers, something like this:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" >
    <asp:FileUpload ID="FileUpload1" runat="server" />
    <asp:Button ID="btnPostBack" runat="server" Text="My PostBack Button" OnClick="btnPostBack_Click" />
    <asp:PostBackTrigger ControlID="btnPostBack" />

    Don't forget to include the enctype="multipart/form-data" in your <form> tag.
    LVL 1

    Expert Comment

    Good post!
    But when i used your mthod it doesnt work for me. The Fileupload.Hasfile return false. but when i keep it outside the updatepanel no drama even with not including the enctype.
    Any ideas
    LVL 2

    Expert Comment

    Mmm I forgot to mention that the updatePanel shown in my code, is a sub-UpdatePanel, that is, there should be another outer UpdatePanel around all your other code... hope this helps!

    Expert Comment

    Just to say thanks to murking - your solution of a nested update panel and triggers worked great for me.
    LVL 2

    Expert Comment

    thanks nsq888!

    I'm glad it helped you
    LVL 7

    Expert Comment

    This guy has figured out all the permutations ->

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
    Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now