Click here to Skip to main content
12,395,946 members (55,407 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET Ajax
Hi.. In my project i have to use Modal pop up extender when i click the Link Button.. In this Link button i code Click Event.. If i place a break point in
protected void LinkButton1_Click(object sender, EventArgs e) its dosent captured.. Can any one help me.. Thanks in advance. Smile | :)

<asp:LinkButton ID="LinkButton1" runat="server" BackColor="#FF8000" BorderColor="White" ForeColor="White" Height="30px" Font-Bold="True" Font-Underline="False" Width="78px" OnClick="LinkButton1_Click" >Get Inspired 

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
        CancelControlID="bmclose" PopupControlID="p1" TargetControlID="LinkButton1">
    <asp:Panel ID="p1" runat="server" Height="345" Width="40%">
        <div align="right" style="width:120%">
            <asp:ImageButton ID="bmclose" runat="server" ImageUrl="~/images/Close.png" />&nbsp;
        <div id="PopupPanel">
            <asp:Panel ID="Panel1" runat="server" BackColor="white" BorderColor="#666666" BorderStyle="Solid"
                BorderWidth="2" CssClass="mypanel" Width="120%">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                        <div align="center">
                            <br />
                            <br />
                            <br />
                            <br />
                            <table width="88%">
                                    <td width="35%">
                                    <td width="60%">
                                        <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label></td>
                                    <td width="5%">
                                    <td align="left">
                                        <asp:Label ID="lblGen" runat="server" Text="Gender" ForeColor="Black"></asp:Label>
                                    <td align="left">
                                        <asp:RadioButtonList ID="radGen" runat="server" ForeColor="Black" RepeatDirection="Horizontal">
                                    <td align="center">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="radGen"
                                            ErrorMessage="*" Font-Bold="true" Font-Names="Arial" Font-Size="Large" ValidationGroup="onadd"></asp:RequiredFieldValidator>
                                <tr height="30">
                                <asp:Label ID="lblDob" runat="server" Text="Date of Birth" ForeColor="black" ></asp:Label>
                                <asp:TextBox ID="txtDob" runat="server" ForeColor="Black" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDob"
                                <tr height="30"></tr>
            <asp:Label ID="lblcountry" runat="server" Text="Country" ForeColor="Black"></asp:Label>
            <td >
            <select id="ddlcountry" runat="server" class="select" name="country" style="width: 201px">
                                        <option selected="selected" value="0">Choose the Country..</option>
                                        <option value="Afghanistan">Afghanistan</option>
                                        <option value="Åland Islands">Åland Islands</option>
                                        <option value="Albania">Albania</option>
                                        <option value="Algeria">Algeria</option>
                                        <option value="American Samoa">American Samoa</option>
                                        <option value="Andorra">Andorra</option>
                                        <option value="Angola">Angola</option>
                                        <option value="Anguilla">Anguilla</option>
                                        <option value="Antarctica">Antarctica</option>
                                        <option value="Antigua and Barbuda">Antigua and Barbuda</option>
                                        <option value="Argentina">Argentina</option>
                                        <option value="Armenia">Armenia</option>
                                        <option value="Aruba">Aruba</option>
                                        <option value="Australia">Australia</option>
                                        <option value="Austria">Austria</option>
                                        <option value="Azerbaijan">Azerbaijan</option>
                                        <option value="Bahamas">Bahamas</option>
                                        <option value="Bahrain">Bahrain</option>
                <option value="Bangladesh">Bangladesh</option>
Posted 27-Mar-13 0:14am
Updated 27-Mar-13 0:25am
Raje_ 27-Mar-13 6:22am
Is your model pop inside Update Panel ? Can you please post your codes ?
supriya chaladi 27-Mar-13 6:30am
check update panel update mode="Condional" or not

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It seems you want to open your model pop on link button click.
Because you are using Update panel so:-
Wrap your all codes(controls) (model pop up extender + your panel + your linkbutton) inside update panel.

<asp:updatepanel id="updGrid" runat="server">
         <!-- your model pop up extender and your panel and linkbutton -->

because you have specified, your TargetControlID is your link button so you don't need to write your click event. Infact it will not fire the click event. if you want to fire click event of your link button then for TargetControlID use some other controls.

hope you got it.

Happy holi.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 27 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100