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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:38:06+00:00 2026-05-27T16:38:06+00:00

I want to fire the AsnyncFileUpload control through another control in the page. I

  • 0

I want to fire the AsnyncFileUpload control through another control in the page.

I have used AsyncfileUpload from ASP.NET AJAX toolkit and hidden it through JQuery. And places a button next to it. When even i click this button and select a file i want to fire the AsycnFileUpload and upload files.

I have written most of the code but i get an Javascript error when i select a file.


(ERROR: Access Denied;

PLACE: setTimeout(function () {
mainForm.submit(); //Error here;
uploader._waitTimer = setTimeout(function () { uploader._wait() }, 100);
}, 0);


<asp:Button ID="btnFileUpload" runat="server" Text="Add" onclientclick="FileUploadClick(); return false;"/>
<ajaxToolkit:AsyncFileUpload  runat="server" ID="AsyncFileUpload1" Width="400px" UploaderStyle="Modern" UploadingBackColor="#CCFFFF"/>

And this is my Javascript (I saw the markup generated by the control and got the File input
type by appending “_ct102”)

function FileUploadClick() {
            var fileUploadControl = document.getElementById('<%= AsyncFileUpload1.ClientID %>' + '_ctl02')
            fileUploadControl.click();
            //fileUploadControl.setActive();                
        }
  • 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-27T16:38:06+00:00Added an answer on May 27, 2026 at 4:38 pm

    I researched this more and found that this cannot be done.
    Firing the file type input from other control is disabled due to security reason. So this cant be done.

    Only workaround to style fileupload control is to place the control with opacity 0 and placing our control below this file control and changing the Z-index in HTML.
    Infact this is the exact trick used be the AsyncFileUpload control.

    Here is the link explaing the trick
    http://www.quirksmode.org/dom/inputfile.html

    So i applied this trick on the AsyncFileUpload which internally is applying it on HTML file upload control

    Thanks All

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

Sidebar

Related Questions

I have some problems with ASP.NET page cycle. I want to fire event when
I have a asp:textbox with a OnTextChanged event that I want to fire when
I have an ICommand that I want to fire (make the execute go) from
I want to run some code from an ASP.NET MVC controller action in a
I want to fire a server-side ASP.NET button click event in JavaScript. I checked
I have a periodically_call_remote that I want to fire right away (as if the
I have several sql queries that I simply want to fire at the database.
I have a Data grid with DatagridComboBoxColumn , and i want to Fire Event
i have 2 divs next to each other i want mouseleave to fire when
I want to let TextBox control TextChanged event fire only when there are more

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.