Click here to Skip to main content
Rate this: bad
good
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">
    </cc1:ModalPopupExtender>
    <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>
        <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">
                    <ContentTemplate>
                        <div align="center">
                            <br />
                            <br />
                            <br />
                            <br />
                            <table width="88%">
                                <tr>
                                    <td width="35%">
                                    </td>
                                    <td width="60%">
                                        <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label></td>
                                    <td width="5%">
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left">
                                        <asp:Label ID="lblGen" runat="server" Text="Gender" ForeColor="Black"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:RadioButtonList ID="radGen" runat="server" ForeColor="Black" RepeatDirection="Horizontal">
                                        <asp:ListItem>Male</asp:ListItem>
                                        <asp:ListItem>Female</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                    <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>
                                    </td>
                                </tr>
                                <tr height="30">
                                </tr>
                                <tr>
                                <td>
                                <asp:Label ID="lblDob" runat="server" Text="Date of Birth" ForeColor="black" ></asp:Label>
                                </td>
                                <td>
                                <asp:TextBox ID="txtDob" runat="server" ForeColor="Black" />
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDob"
                                        ErrorMessage="*"></asp:RequiredFieldValidator></td>
                                </tr>
                                <tr height="30"></tr>
 
                                <tr>
                                 <td>
            <asp:Label ID="lblcountry" runat="server" Text="Country" ForeColor="Black"></asp:Label>
            </td>
            <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>
               
               on>
Posted 27-Mar-13 1:14am
Edited 27-Mar-13 1:25am
v2
Comments
Raje_ at 27-Mar-13 6:22am
   
Is your model pop inside Update Panel ? Can you please post your codes ?
supriya chaladi at 27-Mar-13 6:30am
   
check update panel update mode="Condional" or not

1 solution

Rate this: bad
good
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">
      <contenttemplate>
          <!-- your model pop up extender and your panel and linkbutton -->
      <contenttemplate>
   </contenttemplate></asp:updatepanel>
 
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.
  Permalink  
v3

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 609
1 OriginalGriff 587
2 Maciej Los 325
3 Mathew Soji 195
4 BillWoodruff 190
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 27 Mar 2013
Copyright © CodeProject, 1999-2014
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