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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:19:23+00:00 2026-05-13T11:19:23+00:00

I came across the following given a asp.net page containing <div id=’test’> <input type=’checkbox’

  • 0

I came across the following given a asp.net page containing

<div id='test'>
  <input type='checkbox' id='ch1' name='ch1' runat=server />
  <input type="button" id="view_test" />
</div>

and the following jquery code to show this div in a dialog

$("#view_test").click(function() {
    $("#test").dialog({ show: 'slide', width: 600, title: 'View Check' });
});

If view_test button was clicked, initializing the dialog, before the form post backs the checkbox ch1.Checked property in .Net is always False. However if you just postback without initializing the dialog it works as expected.

It’s the strangest thing…

  • 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-13T11:19:24+00:00Added an answer on May 13, 2026 at 11:19 am

    The jquery dialog is moved in the dom when it’s created. After creating the dialog, try moving it back into the form tag:

    $("#test").parent().appendTo($("form:first"));
    

    Edit – Here’s more complete code:

    <script type="text/javascript">
        $(function() {
    
            $("#view_test").click(function() {
                $("#test").dialog({ show: 'slide', width: 600, title: 'View Check' });
                $("#test").parent().appendTo($("form:first"));
            });
        });
    </script>
    
    <body>
        <form id="form1" runat="server">
        <div>
            <div id="test">            
                <input type="checkbox" id="ch1" name="ch1" runat="server" />test
                <input type="button" id="view_test" value="click" />            
            </div>    
            <asp:Button ID="btnSubmit" runat="server" Text="submit" 
                onclick="btnSubmit_Click" />    
        </div>
        </form>
    </body>
    

    Code behind:

    public partial class Tests_Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Response.Write(ch1.Checked.ToString());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across the following question. Given an array of n elements and an
I came across the following code - what is the data type of col_8888
Recently I came across following grep command: /usr/xpg4/bin/grep -Ff grep.txt input.txt > output.txt which
I came across the following markup in a JSP file in a legacy app
Today at work we came across the following code (some of you might recognize
Looking through some code I came across the following code trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto)); and I'd like
I'm trying to debug an application (under PostgreSQL) and came across the following error:
When refactoring away some #defines I came across declarations similar to the following in
Whilst trawling through some old code I came across something similar to the following:
I created an ASP.NET MVC 2.0 Application. It ran fine at first test and

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.