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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:20:05+00:00 2026-06-09T16:20:05+00:00

I want open a Dialog with Controls and it must open if I click

  • 0

I want open a Dialog with Controls and it must open if I click on a LinkButton in a ListView. I want make it with a CommandName and OnCommand Argumen.

My Application:

In My Application can a User search other Users about a textBox and list the users in a ListView. Than he can display more Informations about one User if the user click on the LinkButton.

enter image description here

If I make it about a normal Button, the Dialog open but if I make it about the LinkButton with CommandName it Don’t work.

My Code:

<form id="form1" runat="server">

    <asp:HiddenField ID="hidForModel" runat="server" />

    <asp:scriptmanager id="ScriptManager1" runat="server">
       </asp:scriptmanager> 

       <asp:modalpopupextender id="ModalPopupExtender1" 
                runat="server" cancelcontrolid="btnCancel" 
                okcontrolid="btnOkay" targetcontrolid="hidForModel" 
                popupcontrolid="Panel1" popupdraghandlecontrolid="PopupHeader" 
                drag="true" backgroundcssclass="ModalPopupBG">

</asp:modalpopupextender>

            <div class="popupConfirmation" id="Panel1" >
              <asp:Panel runat="server" ID="PopupHeader" CssClass="modalPopup">Benutzerinformationen</asp:Panel>
                <div class="Body">
                    Hallo
                    <asp:Button id="btnOkay" runat="server" text="Speichern" />
                    <asp:Button id="btnCancel" runat="server" text="Abbrechen" />
                </div>

            </div>


    <div class="header">
        <table id="SuchTabelle" runat="server" border="0">

            <tr>
                <th><asp:Label ID="id_SearchUser" runat="server" Text="lblSearchUser"></asp:Label></th>
                <th><asp:TextBox ID="txtBenutzer" runat="server" Width="250px"></asp:TextBox></th>

            </tr>
            <tr>
                <th><asp:Label ID="id_location" runat="server" Text="lblLocation"></asp:Label></th>
                <th><asp:DropDownList ID="dropWerk" runat="server" Width="250px" /></th>
                <th><asp:Button ID="Button2" runat="server" Text="Suchen" 
                                onclick="btnBenutzerSuchen_Click" Width="219px" /></th>
            </tr>

        </table>

        <div id="bild">
            <asp:Image runat="server" ImageUrl="~/App_Theme/lw_logo.jpg" Height="58px" 
                Width="277px" />
        </div>

      </div>

      <div class="bodyList">



        <asp:ListView runat="server" ID="myListView">

        <LayoutTemplate>
            <table id="UserTable" runat="server" border="0" width="800" cellpadding="0" cellspacing="0">
                <tr style="background-color:#E5E5FE" class="TableClass">
                    <th id="th1" runat="server"><asp:LinkButton ID="lnkBenutzer" runat="server" >id_Benutzer</asp:LinkButton></th>
                    <th id="th2" runat="server"><asp:LinkButton ID="lnkemail" runat="server" >id_Email</asp:LinkButton></th>
                    <th id="th3" runat="server"><asp:LinkButton ID="lnkVorname" runat="server" >id_Vorname</asp:LinkButton></th>
                    <th id="th4" runat="server"><asp:LinkButton ID="lnkNachname" runat="server" >id_Nachname</asp:LinkButton></th>
                    <th id="th5" runat="server"><asp:LinkButton ID="lnkTelefon" runat="server" >id_Telefon</asp:LinkButton></th>
                </tr>
                <tr runat="server" id="ItemPlaceholder">
                </tr>
            </table>
        </LayoutTemplate>

        <ItemTemplate>

            <tr class="TableClass">    
                <td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server"  /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server"  /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server"  /></td>

              <td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>

            </tr>

        </ItemTemplate>

        <AlternatingItemTemplate>

            <tr class="TableClass"> 

                <td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>

                <td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>

            </tr>

        </AlternatingItemTemplate>

        </asp:ListView>

        <br />
        <br />

    </div>

    </form>

My C# Code:

protected void Button1_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                ModalPopupExtender1.Show(); // error :(

            }

        }

My Errortext:

System.InvalidOperationException: The ListView “myListView” has one SelectedIndexChanging-Event execute, which was not treated.

I need help 🙁

The Update:

protected void myListView_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                txtVorname.Text = "test";

                PopUpDialog.Show();  //<-- Here is the error 

            }
        }

I make a breakpoint and see …

enter image description here

tarasov

  • 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-09T16:20:07+00:00Added an answer on June 9, 2026 at 4:20 pm

    Try this:

    Handle “ItemCommand” Event of “ListView”:

    protected void myListView_ItemCommand(object sender, ListViewCommandEventArgs e)
      {
        if (String.Equals(e.CommandName, "Select"))
        {
          ModalPopupExtender1.Show();
          //your code
        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to show a open dialog for the user, where the user can
I want to open a file dialog box in user control. I used using
I want to open a jQuery UI dialog when a user presses enter or
When the user clicks a certain LinkButton, I need to open a confirmation dialog
I want the open dialog to filter files by *.spectrum or not filter it
I want to open a custom dialog in onHandleIntent() method of an IntentService class,
I want to open a MFC modeless dialog from a MFC dll injected into
I want to use the sharer.php popup to open the share dialog, but would
I want to resize the dialog dynamically just before I open it, but this
want to open pdf file when a user clicks on hyperlink shown in gridview

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.