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 6471847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:16:21+00:00 2026-05-25T06:16:21+00:00

I am using Ajax File Upload control in ASP.NET 4 using c#. The same

  • 0

I am using Ajax File Upload control in ASP.NET 4 using c#. The same page has an update panel too but the upload control is not inside the update panel. The upload control is outside of the update panel.

The update panel has a captcha image and submit button which is described here too. The submit button inside contains code for saving the file from upload control.

The problem is that when user has browsed the fife to be uploaded using upload control and then enters a wrong captcha value and submits, then a new captcha image is given asynchronously to the user for entry. Now the upload control still shows the path in the upload bar for the file, but on the programming side it does not detects the file.

The submit button code:

if (AsyncFileUpload.HasFile)
{
  // upload logic and other stuff
}
else
{
  // lblShow.Text = "There is no file to be uploaded";
}

The above code for example executes the else part to say “There is no file to be uploaded”. The page still hasn’t refreshed totally and the file upload control has the path of the file displayed. Kindly help me with this problem.

  • 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-25T06:16:22+00:00Added an answer on May 25, 2026 at 6:16 am

    If your code:

    if (AsyncFileUpload.HasFile)
    {
      // upload logic and other stuff
    }
    else
    {
      // lblShow.Text = "There is no file to be uploaded";
    }
    

    is in the Page_Load event, it will still execute in the context of a partial post-back, e.g. the UpdatePanel refresh. If a full form submit has not been performed from the browser (you mentioned your File Upload is outside of the UpdatePanel) then the page will not detect the file upload.

    What I am confused about is why you have called it AsyncFileUpload when it is outside the UpdatePanel?

    EDIT:

    Based on your answer, I don’t think your Captcha implementation is workable with async file upload as you have it now.

    The UpdatePanel does an async POST to evaluate captcha result, but you will not POST the file contents yet because its not inside the UpdatePanel. Then your server-side code evaluates the captcha result and will either return html or a redirect in the async-response back to the browser… somewhere you need to eventually submit the form to get the file.

    Unless you’re prepared to write code to send some javascript back to your page in the async-response to trigger a full form submit, AND re-evaluate CAPTCHA again on the form submit, you’re probably better off taking out the UpdatePanel, in my opinion.

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

Sidebar

Related Questions

I m using asp.net 2.0 without AJAX. The file path in the fileupload control
How to upload image using jQuery (AJAX) and ASMX web service - asp.net? I
I'm using FormData to ajax a file upload. The upload works, but the problem
Simply this the code for PHP page the uses AJAX to upload file, but
I need to upload images using FileUpload without postback(using Ajax).I tried many examples.But in
I am using JavaScript and jQuery. My main file has My.js and Ajax. My.js
Can you do ajax on ASP.net webform without using ajax toolkit? (Please post a
Does anybody know of an up to date tutorial on using Ajax with ASP.net
i am using Fileupload and 3 dropdown control in update panel, 3 dropdown will
HI folks, I have a .net application (vb.net) and I'm using the ajax control

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.