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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:41:11+00:00 2026-05-13T22:41:11+00:00

I work on Asp.Net VS08 C#. Clicking on Button want to show popup. popup

  • 0

I work on Asp.Net VS08 C#. Clicking on Button want to show popup. popup contain a button ,Clicking on button perform serverside event but popup not close,popup close only click on cancel button .My problem is .i can call a popup but clicking on button not Perform server side event.

Aspx Code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Popup3.aspx.cs" Inherits="Jquery1._8Version.Popup3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
      <link type="text/css" href="css/ui-lightness/jquery-ui-1.8rc2.custom.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8rc2.custom.min.js"></script>

    <script type="text/javascript">
        function openModalDiv(divname) {

            $("#Popup").dialog({
                bgiframe: true,
                autoOpen: false,
                height: 300,
                modal: true,
                buttons: {
                    Cancel: function() {
                        $(this).dialog("close");
                    }
                },
                close: function() {
                    allFields.val("").removeClass("ui-state-error");
                }
            });
            $("#Popup").dialog("open");
        }       
    </script>


</head>
<body>
     <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

    <div id="Popup" style="display: none;"   title="Basic dialog">
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />
    </div>

    </ContentTemplate>
    </asp:UpdatePanel>

     <input id="Button3" type="button" value="Open 1" onclick="javascript:openModalDiv('Popup');" />       
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>


    </form>
</body>
</html>

C# code:

protected void Button2_Click(object sender, EventArgs e)
        {
            Label1.Text = DateTime.Now.ToString();
        }
  • 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-13T22:41:12+00:00Added an answer on May 13, 2026 at 10:41 pm

    I think this is what you’re after:

    <script type="text/javascript">
      $(function() {
          $("#Popup").dialog({
              bgiframe: true,
              autoOpen: false,
              height: 300,
              modal: true,
              buttons: {
                  Cancel: function() {
                      $(this).dialog("close");
                  }
              },
             close: function() {
                  allFields.val("").removeClass("ui-state-error");
             }
          }).parent().appendTo($("form:first"));
          $("#Button3").click() {
            $("#Popup").dialog("open");
          });
        });
    </script>
    

    And just remove the onclick from the button, should be just this:

    <input id="Button3" type="button" value="Open 1" />
    

    The key part is this: .parent().appendTo($("form:first")). By default the modal is added to the body, which is outside the form. The result is that button data is never sent with the submit, and the server doesn’t know the button was clicked, or to do anything. This tells the modal to hop right inside the end of the form. Try it, should resolve your issue.

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

Sidebar

Related Questions

I work on Asp.Net vs08 C# .I want to show popup ** Bottom** of
I am developing web application using asp.net, but i want to work on asp
work on asp.net vs05.i want to set mouse event on gridview Then based on
work on asp.net vs05. i know how to show popup ,in my below syntax
work on asp.net vs 05 C#.Master page header contain the bellow code <script type=text/javascript
The ASP.NET validation does not seem to work inside ASP:FormView. Can someone let me
Not being into ASP.NET world too much, I still faced a neccessity to work
I can't get a Facebook Like button to work on an ASP.NET page. I've
ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not
Is it possible, that Spring.Net Aspects don't work with Asp.Net Controller? I want to

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.