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

  • Home
  • SEARCH
  • 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 774113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:04:38+00:00 2026-05-14T19:04:38+00:00

I’m developing an ASP.NET application with C# and Visual Studio 2008 SP1. I’m using

  • 0

I’m developing an ASP.NET application with C# and Visual Studio 2008 SP1. I’m using WebForms.

I have an ASPX page with two UpdatePanels, one on the left that holds a TreeView and other on the right where I load dynamically user controls.

One user control, that I used on right panel, has a FileUpload control and a button to save that file on server. The ascx code to save control is:

<asp:UpdatePanel ID="UpdatePanelBotons" runat="server" RenderMode="Inline" 
    UpdateMode="Conditional">
<ContentTemplate>
    <asp:Button ID="Save" runat="server" Text="Guardar" 
                onclick="Save_Click" CssClass="button" />
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="Save" />
    </Triggers>
</asp:UpdatePanel>

I make a full postback to upload the file to the server and save it to database. But I always getting False on FileUpload.HasFile.

I problem is the right UpdatePanel. I need it to load dynamically the user controls. This panel has three UpdatePanels to load the three user controls that I use.

Maybe I can use an Async File Uploader or delete the right Update Panel and do a full postback to load controls dynamically.

Any advice?

UPDATE:

RegisterPostBackControl works… the second time I click on save button. First time FileUpload.HasFile is FALSE, and second time is TRUE.

Second Update
On first click I also check ScriptManager.IsInAsyncPostBack and is FALSE. I don’t understand ANYTHING!!

Why?

The code to load user control first time, and on each postback is:

DynamicControls.CreateDestination ud =
            this.LoadControl(ucUrl) as DynamicControls.CreateDestination;
if (ud != null)
{
    Button save = ud.FindControl("Save") as Button;
    if (save != null) 
        ScriptManager1.RegisterPostBackControl(save);
    PanelDestination.Controls.Add(ud);
}

Thank you.

  • 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-14T19:04:39+00:00Added an answer on May 14, 2026 at 7:04 pm

    For me this solution worked:

    add
    Page.Form.Attributes.Add(“enctype”, “multipart/form-data”);

    The enctype attribute is missing on the first postback.

    http://adamnoffie.blogspot.com/2007/10/file-upload-not-working-on-first.html

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

Sidebar

Ask A Question

Stats

  • Questions 447k
  • Answers 447k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The second parameter is the selector context. It restricts searching… May 15, 2026 at 7:31 pm
  • Editorial Team
    Editorial Team added an answer Your javascript is not actually calling anything. Rather, it is… May 15, 2026 at 7:31 pm
  • Editorial Team
    Editorial Team added an answer I have been able to reproduce your error message with… May 15, 2026 at 7:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.