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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:10:49+00:00 2026-05-30T20:10:49+00:00

I am placing some ASP.NET html elements(that upload a file) inside a JQuery Dialog.

  • 0

I am placing some ASP.NET html elements(that upload a file) inside a JQuery Dialog.

My Problem: When I click the button to upload the file, nothing happens. I create the query dialog dynamically AFTER the page has loaded. My solution is to place the HTML/ASP elements(for uploading a file) in a div at the bottom of the body of the page & set its display to none.

Then upon opening the dialog, I move the HTML/ASP elements into the JQuery dialog. But my problem is that when I click my ASP.NET button to upload the file from within the dialog, nothing happens?

Note if I click the button whilst its outside the JQuery dialog is sucessfully uploads the file.

Whats going wrong & how do I fix this? Is there an easier way to add ASP.NET code to a JQuery dialog AFTER the page has loaded?

This sits in the body

<div id="test">
    <input class="ui-button ui-widget ui-state-default ui-corner-all 
       ui-button-text-only" 
      style="display: inline-block;" id="fileUpload" type="file" Runat="server" 
       NAME="fileUpload"/>

    <asp:button id="btnSave" OnClick="bt1Clicked" style="display: inline;" 
      class="ui-button ui-widget ui-state-default ui-corner-all 
                                                 ui-button-text-only" 
      runat="server" Text="Upload File" ></asp:button>

    <asp:label id="lblMessage" runat="server" style="height:20px;width:390px;"
    </asp:label> 
</div>

Then on dialog open I grab the above HTML & move it into the dialog:

$(this.dialog).dialog('open' function()
{
   var e = $("#test");
   $(body).remove(e);
   $(this).append(e);
});
  • 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-30T20:10:50+00:00Added an answer on May 30, 2026 at 8:10 pm

    jQuery UI dialog creates the dialog elements at the very end of the document, right before the closing </body> element. So when you open your dialog and move your content div#test into the dialog, it is outside the <form> and does not work anymore with asp.net which requires it.

    Try to create your dialog and move it back inside the <form> element:

    $("#myDialog").dialog({
        ...
    }).parent().appendTo($("form"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been playing with jQuery in an ASP.NET project and am finding some odd
I'm working on a ASP.NET website that on some requests will run a very
I'm playing around with some Dependency Injection ( StructureMap ) with my ASP.NET MVC
I'm creating an SQL file, placing this file into a zip file with some
I'm working on a new ASP.NET MVC / JQuery app which will need to
Environment: ASP.NET MVC3 C# Say I have some repository (semi-psuedo): public interface IRepository {
I read some of the posts on this problem, and then recommended placing the
I'm just playing with some linq and asp.net - absolute beginner so I'm not
Clarification: Put simply, I'd like to put an ASP.NET UpdatePanel inside the info window
I'm designing some VB based ASP.NET 2.0, and I am trying to make 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.