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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:23:10+00:00 2026-06-11T13:23:10+00:00

My Application: I have a ASP.NET Application with two parts. First part is the

  • 0

My Application:

I have a ASP.NET Application with two parts. First part is the “Absence” Part and the second part is “Signature”. This Application create this parts Automatic. For Absence the User must input the Enddate from this absence and a representative. The TextBox for the representative have a AutoComplete that get Data from the Active Directory. And with a Image on the right side of the textbox, the user can search a representative in a Modal popup from jQuery. The Popup has one textbox and a imagebutton with a magnifying glass Symbol. Now I want that if I click on this Symbol I get all found representative in a ListView in the PopUpBox with a fixed Width and Height.

My Problem:

My PopUp open and I can set my Controls in the div block for this popupdialog. I have create a Event for my ImageButton and generate the Code for this but if I click on the Button (in the popupdialog) the Code don’t work. It doesn’t jump in the Button_click Method 🙁

My Question:

How I can use the Controls in my popupdialog with jquery and asp.net?

Here my Code:

ASPX: (jquery code)

<script type="text/javascript" language="javascript">

        $(document).ready(function () {
            $("#dialogbox").dialog({
                autoOpen: false,
                modal: true,
                resizable: false,
                buttons: {
                    "OK": function () {
                        $(this).dialog("close");
                    },
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });

            $("#imgVertreter").click(function () {
                $("#dialogbox").dialog("open");
                return false;
            });
        }); 

    </script>

aspx: (my popupdialogbox div code)

<div id="dialogbox" title="Gesammte Vertreterliste">
        <asp:TextBox ID="pVertreter" runat="server"></asp:TextBox>
        <asp:ImageButton ID="pImageSearch" runat="server" 
        ImageUrl="~/App_Theme/lupe.jpg" Height="23px" Width="24px" 
            onclick="pImageSearch_Click" /><br />
        <hr />
        <asp:ListView runat="server" ID="ListView">

            <LayoutTemplate>
                <table id="UserTable" runat="server" border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr style="background-color:#ccdaeb" class="tableClass">
                        <th align="left" id="th4" runat="server"><asp:Label ID="lblName" runat="server" Text="Name, Vorname"></asp:Label></th>
                        <th align="left" id="th3" runat="server"><asp:Label ID="lblAbteilung" runat="server" Text="Abteilung"></asp:Label></th>
                    </tr>
                </table>
            </LayoutTemplate>

            <ItemTemplate>
                <tr>
                  <td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="lblFullname" Text='<%# Eval("Name") %>' runat="server"></asp:LinkButton></td>
                  <td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="lblAbteil" Text='<%# Eval("Abteilung") %>' runat="server"></asp:LinkButton></td>
                </tr>
            </ItemTemplate>

            <EmptyDataTemplate>
                Es wurden keine Einträge gefunden
            </EmptyDataTemplate>

            <AlternatingItemTemplate>
                <tr class="TableClass">
                    <td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="lblFullname" Text='<%# Eval("Name") %>' runat="server"></asp:LinkButton></td>
                  <td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="lblAbteil" Text='<%# Eval("Abteilung") %>' runat="server"></asp:LinkButton></td>
                </tr>
            </AlternatingItemTemplate>

        </asp:ListView>

    </div>

My C# Code for the imageButton (pImageSearch)

 protected void pImageSearch_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                UserService srv = new UserService();

                DataTable dt = srv.BenutzerFinden(Domain, pVertreter.Text);
                DataView dv = new DataView(dt);

                dv.Sort = "Nachname ASC";

                this.ListView.DataSource = dv;
                this.ListView.DataBind(); 
            }
            catch (Exception)
            {

            }


        }

Here is a Picture from my Application :

enter image description here

Sourcecode in IE for my TestApplication that works!

<div id="dialog" title="Liste">
<input name="txtBox" type="text" value="rettet" id="txtBox" />
<input type="submit" name="btnEdit" value="übergeben" id="btnEdit" />
</div>

Sourcecode for my main Application that don’t work!

<div id="dialogbox" title="Vertreterliste">
<input name="pVertreter" type="text" id="pVertreter" />
<input type="image" name="pImageSearch" id="pImageSearch" src="App_Theme/lupe.jpg" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;pImageSearch&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" style="height:23px;width:24px;" /><br />
<input type="submit" name="suchen" value="suchen" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;suchen&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="suchen" />
</div>

Why is here a onclick with a dopostback Oo?

  • 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-06-11T13:23:11+00:00Added an answer on June 11, 2026 at 1:23 pm

    jQuery modals are created by cloning the DOM elements and placing them at the of the body tag.
    This create valid DOM elements and it works fine on the client side.

    However for asp.net controls to send events, they must be inside the form tag(asp.net creates only one form tag).

    The solution is to create the dialog and then place the elements back into the form tag.

        $(document).ready(function () {
            $("#dialogbox").dialog({
                autoOpen: false,
                modal: true,
                resizable: false,
                buttons: {
                    "OK": function () {
                        $(this).dialog("close");
                    },
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });
    
            $("#dialogbox").parent().appendTo($("form:first"));
    
            $("#imgVertreter").click(function () {
                $("#dialogbox").dialog("open");
                $("#dialogbox").parent().appendTo($("form:first"));
                return false;
            });          
        }); 
    

    Your server events should now fire perfectly after that.

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

Sidebar

Related Questions

As part of building an ASP.net application, I have to display two things for
I have an ASP.NET MVC3 application that I have built and it has two
I have an asp.net application and I need to have two sessions running at
In the asp.net mvc 3 application I have two views which have the same
I have the following class as part of an asp.net application. public sealed class
I trying to display image in picture box. The application have two part. First
In my asp.net application I have two pages like new students and edit students.
First, a little background. I have two ASP.NET web applications that use SQLServer session
I have inherited an application that uses the ASP.NET membership provider for user management.
I have an ASP.NET application. Basically the delivery process is this one : Nant

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.