Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6914455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:20:58+00:00 2026-05-27T09:20:58+00:00

This is not just another FileUpload + UpdatePanel question. I have, as stated in

  • 0

This is not just another FileUpload + UpdatePanel question.

I have, as stated in the many similar posts, an UpdatePanel and a FileUpload control on my form. I also have a PostBackTrigger set up for my upload button.
It works. The catch is it never does work on first time click. That is:

I click on browse, select my file, press upload. Nothing happens (fupld.HasFile = false);

I click on browse again, select any file (the same or another), press upload and it works fine.

<asp:UpdatePanel ID="upGeneral" runat="server" >
   <ContentTemplate>
       ...
       <table id="tabPage10" runat="server" visible="false" width="100%" >
          <tr>
              ...
              <td>
                  <asp:FileUpload ID="fupld" runat="server" Width="80%" />
                  <asp:ImageButton ID="ibtnUpld" runat="server" onclick="ibtnUpld_Click" />
              <td>
              ...
          <tr>
       ...
   </ContentTemplate>
   <Triggers>
      <asp:PostBackTrigger ControlID="ibtnUpld" />
   </Triggers>
</asp:UpdatePanel>

I’ve looked around for answers, but this is some really weird behaviour. No luck so far.

Any ideas?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:20:59+00:00Added an answer on May 27, 2026 at 9:20 am

    Well, the FileUpload control is designed to be used only in postback scenarios and not in asynchronous postback scenarios during partial-page rendering.

    http://msdn.microsoft.com/en-us/ysf0192b#using_the_FileUpload_Control_with_the_UpdatePanel_control

    You could use the AsyncFileUpload control instead from the AjaxControlToolkit.

    <asp:AsyncFileUpload runat="server" ID="asyncFileUpload" Width="400px" ThrobberID="imageThrobber"
       OnClientUploadStarted="uploadStarted" OnClientUploadError="uploadError"
       ClientIDMode="AutoID" PersistFile="true" PersistedStoreType="Session" />
    

    code behind:

         if (asyncFileUpload.HasFile)
         {
            string fullPath = GetPath(asyncFileUpload.FileName);
            asyncFileUpload.SaveAs(fullPath);
         }
    

    I’ve never had any problems with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may sound like a stupid question but I'm a beginner not just to
Note, this question is a bit subtle so read it carefully: I'm not just
This is not really a question because I just solved the problem, but I
This might not have a major usecase in projects, but I was just trying
Prefacing this with the text 'just another beginner'. when you have the result of
No this is not another question about how to use AJAX. Why does this
How can I update this regular expression to find and replace not just /news/
There's something wrong with my code or I'm just not understanding this fully. I
Just could not get this one and googling did not help much either.. First
I just found my code like this does not compile right? Is there any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.