title: Asp .net Show modal popup on click event linkbutton which is on Modal popup
body: <p>I shown Modal popup (Modal2) on this Modal popup I have grid contain link button.
  on click event of link button i have to show another modal popup having grid.</p>
  
  <p>My First Modal popup Showing </p>
  
  <pre><code>&lt;asp:Button ID="btnScholershipApp" runat="server" Text="Button" SkinID="SelectButton" /&gt;
          &lt;Ajax:ModalPopupExtender ID="Modal2" runat="server" PopupControlID="table2" CancelControlID="img1"
              TargetControlID="btnScholershipApp" OnCancelScript="javascript:__doPostBack('clearfields2')"&gt;
          &lt;/Ajax:ModalPopupExtender&gt;
  </code></pre>
  
  <p>First Modal popup</p>
  
  <pre><code> &lt;table id="table2" runat="server" border="0" cellpadding="0" cellspacing="0" height="100%"
      style="border-collapse: collapse; height: auto; margin: 0px; padding: 0px; display: none;"
      width="1000" class="popupheading"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;div style="width: 1000px; height: auto;"&gt;
                  &lt;div style="width: 1000px; height: 40px; background-image: url('../../../PopU/top.png');
                      background-repeat: no-repeat;"&gt;
                      &lt;img id="img1" runat="server" height="40" src="~/Images/close1.png" style="float: right;"
                          width="40" /&gt;
                  &lt;/div&gt;
                  &lt;div style="width: 980px; height: auto; min-height: 100px; background-image: url('../../../PopU/center_bg.png');
                      background-repeat: repeat-y; padding: 0 10px 0 10px;"&gt;
                      &lt;asp:Panel ID="modal_panel2" runat="server" Height="550" Width="980"&gt;
                          &lt;table cellpadding="7px" cellspacing="7px" width="100%"&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;fieldset&gt;
                                          &lt;legend class="legend"&gt;Search &lt;/legend&gt;
                                          &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;
                                              &lt;tr&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:Label ID="Label5" runat="server" Text="Student Name"&gt;&lt;/asp:Label&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:TextBox ID="txtSAStudentName" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:Label ID="Label6" runat="server" Text="Student ID"&gt;&lt;/asp:Label&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:TextBox ID="txtSAStudentID" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:Label ID="Label4" runat="server" Text="Scholership Name"&gt;&lt;/asp:Label&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:TextBox ID="txtSAScholershipName" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:Label ID="Label7" runat="server" Text="University PRN"&gt;&lt;/asp:Label&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:TextBox ID="txtSAScholershipPRN" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:Label ID="Label12" runat="server" Text="Date Of Birth"&gt;&lt;/asp:Label&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;asp:TextBox ID="txtSADateOfBirth" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                      &lt;ajaxtoolkit:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True"
                                                          TargetControlID="txtSADateOfBirth"&gt;
                                                      &lt;/ajaxtoolkit:CalendarExtender&gt;
                                                  &lt;/td&gt;
                                              &lt;/tr&gt;
                                          &lt;/table&gt;
                                      &lt;/fieldset&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                          &lt;table width="100%"&gt;
                              &lt;tr style="background-color: #F6F0DB;"&gt;
                                  &lt;td align="center" colspan="4"&gt;
                                      &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
                                          &lt;ContentTemplate&gt;
                                              &lt;asp:HiddenField ID="hfScholershipName" runat="server" /&gt;
                                              &lt;asp:HiddenField ID="hfScholershipPRN" runat="server" /&gt;
                                              &lt;asp:HiddenField ID="hfScholershipApplicationID" runat="server" /&gt;
                                              &lt;asp:HiddenField ID="hfScholershipDocumentID" runat="server" /&gt;
                                              &lt;asp:GridView ID="grdScholershipApp" runat="server" AutoGenerateColumns="false" AllowPaging="True"
                                                  OnPageIndexChanging="grdScholershipApp_PageIndexChanging" PageSize="10" Width="970px"&gt;
                                                  &lt;Columns&gt;
                                                      &lt;asp:BoundField DataField="StudentId" HeaderText="Student ID" /&gt;
                                                      &lt;asp:BoundField DataField="FullName" HeaderText="Student Name"&gt;
                                                          &lt;ItemStyle HorizontalAlign="Center" Width="250" /&gt;
                                                      &lt;/asp:BoundField&gt;
                                                      &lt;asp:BoundField DataField="ScholershipPRN" HeaderText="University PRN" /&gt;
                                                      &lt;asp:BoundField DataField="DateOfBirth" HeaderText="Date of birth" /&gt;
                                                      &lt;asp:BoundField DataField="ScholershipName" HeaderText="Scholership Name" /&gt;
                                                      &lt;asp:TemplateField HeaderText="Options"&gt;
                                                          &lt;ItemTemplate&gt;
                                                              &lt;asp:UpdatePanel ID="pnlup2" runat="server"&gt;
                                                                  &lt;Triggers&gt;
                                                                      &lt;asp:PostBackTrigger ControlID="btnEditStudentApplication" /&gt;
                                                                  &lt;/Triggers&gt;
                                                                  &lt;Triggers&gt;
                                                                      &lt;asp:AsyncPostBackTrigger ControlID="btnStudentDocumentIDShow" EventName="Click" /&gt;
                                                                  &lt;/Triggers&gt;
                                                                  &lt;ContentTemplate&gt;
                                                                      &lt;asp:ImageButton ID="btnEditStudentApplication" runat="server" CommandArgument='&lt;%#Eval("PanomtechServiceID")+";"+Eval("StudentID")+";"+Eval("ScholershipPRN")+";"+Eval("ScholershipName")%&gt;'
                                                                          SkinID="Select" OnClick="btnEditStudentApplication_Click" /&gt;
                                                                      &lt;%--&lt;asp:Panel ID="Panel12" runat="server" &gt;
                                                                          &lt;asp:UpdatePanel ID="UpdatePanel4" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"&gt;
                                                                              &lt;ContentTemplate&gt;
                                                                                  &lt;asp:Button ID="hfbtnStudentDocumentIDShow" runat="server" Style="display: none;" /&gt;
  
                                                                              &lt;/ContentTemplate&gt;
                                                                              &lt;Triggers&gt;
                                                                                  &lt;asp:AsyncPostBackTrigger ControlID="hfbtnStudentDocumentIDShow" EventName="Click" /&gt;
                                                                              &lt;/Triggers&gt;
                                                                          &lt;/asp:UpdatePanel&gt;
                                                                      &lt;/asp:Panel&gt;--%&gt;
                                                                      &lt;asp:LinkButton ID="btnStudentDocumentIDShow" runat="server" Text="Documents" CommandArgument='&lt;%#Eval("PanomtechServiceID")+";"+Eval("StudentID")+";"+Eval("StudentDocumentID")%&gt;'
                                                                          OkControlID="hfbtnStudentDocumentIDShow" /&gt;
                                                                      &lt;%-- OnClick="hfbtnStudentDocumentIDShow_Click" --%&gt;
                                                                      &lt;%--&lt;Ajax:ModalPopupExtender ID="modal4" runat="server" PopupControlID="table4" CancelControlID="img3"
                                                                          TargetControlID="btnStudentDocumentIDShow" OnCancelScript="javascript:__doPostBack('clearfields4')"&gt;
                                                                      &lt;/Ajax:ModalPopupExtender&gt;--%&gt;
                                                                  &lt;/ContentTemplate&gt;
                                                              &lt;/asp:UpdatePanel&gt;
                                                          &lt;/ItemTemplate&gt;
                                                      &lt;/asp:TemplateField&gt;
                                                  &lt;/Columns&gt;
                                                  &lt;EmptyDataTemplate&gt;
                                                      no data.......
                                                  &lt;/EmptyDataTemplate&gt;
                                              &lt;/asp:GridView&gt;
                                          &lt;/ContentTemplate&gt;
                                      &lt;/asp:UpdatePanel&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                      &lt;/asp:Panel&gt;
                  &lt;/div&gt;
                  &lt;div style="width: 1000px; height: 40px; background-image: url('../../../PopU/bottom.png');
                      background-repeat: no-repeat;"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;Ajax:AnimationExtender ID="AnimationExtender2" runat="server" TargetControlID="btnScholershipApp"&gt;
      &lt;Animations&gt;
              &lt;OnClick&gt;              
                  &lt;Parallel AnimationTarget="table2"
                  Duration=".9" Fps="50"&gt;
                  &lt;FadeIn Duration=".9"/&gt;
                  &lt;/Parallel&gt;                 
              &lt;/OnClick&gt;                               
      &lt;/Animations&gt;
  &lt;/Ajax:AnimationExtender&gt;
  </code></pre>
  
  <p>LinkButton Event</p>
  
  <pre><code>protected void hfbtnStudentDocumentIDShow_Click(object sender, EventArgs e)
  {
     modal4.Show();
  }
  </code></pre>
  
  <p>Second Modal  popup</p>
  
  <pre><code>&lt;table id="table4" runat="server" border="0" cellpadding="0" cellspacing="0" height="100%"
      style="border-collapse: collapse; height: auto; margin: 0px; padding: 0px;" width="1000"
      class="popupheading"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;div style="width: 1000px; height: auto;"&gt;
                  &lt;div style="width: 1000px; height: 40px; background-image: url('../../../PopU/top.png');
                      background-repeat: no-repeat;"&gt;
                      &lt;img id="img4" runat="server" height="40" src="~/Images/close1.png" style="float: right;"
                          width="40" /&gt;
                  &lt;/div&gt;
                  &lt;div style="width: 980px; height: auto; min-height: 100px; background-image: url('../../../PopU/center_bg.png');
                      background-repeat: repeat-y; padding: 0 10px 0 10px;"&gt;
                      &lt;asp:Panel ID="modal_panel4" runat="server" Height="550" Width="980"&gt;
                          &lt;table width="100%"&gt;
                              &lt;tr style="background-color: #F6F0DB;"&gt;
                                  &lt;td align="center" colspan="4"&gt;
                                      &lt;asp:UpdatePanel ID="uppanel" runat="server"&gt;
                                          &lt;ContentTemplate&gt;
                                              &lt;asp:GridView ID="grdStudentDocuments" runat="server" AutoGenerateColumns="false"
                                                  AllowPaging="True" OnPageIndexChanging="grdStudentDocuments_PageIndexChanging"
                                                  PageSize="10" Width="970px"&gt;
                                                  &lt;Columns&gt;
                                                      &lt;asp:BoundField DataField="StudentId" HeaderText="Student ID" /&gt;
                                                      &lt;asp:BoundField DataField="FullName" HeaderText="Student Name"&gt;
                                                          &lt;ItemStyle HorizontalAlign="Center" Width="250" /&gt;
                                                      &lt;/asp:BoundField&gt;
                                                      &lt;asp:BoundField DataField="DocumentName" HeaderText="Document Name" /&gt;
                                                      &lt;asp:BoundField DataField="ScholershipPRN" HeaderText="University PRN" /&gt;
                                                      &lt;asp:BoundField DataField="ScholershipName" HeaderText="Scholership Name" /&gt;
                                                      &lt;asp:TemplateField HeaderText="Select"&gt;
                                                          &lt;ItemTemplate&gt;
                                                              &lt;asp:UpdatePanel ID="pnlup3" runat="server"&gt;
                                                                  &lt;Triggers&gt;
                                                                      &lt;asp:PostBackTrigger ControlID="btnEditSStudentDocuments" /&gt;
                                                                  &lt;/Triggers&gt;
                                                                  &lt;ContentTemplate&gt;
                                                                      &lt;asp:ImageButton ID="btnEditSStudentDocuments" runat="server" CommandArgument='&lt;%#Eval("StudentDocumentID")%&gt;'
                                                                          SkinID="Select" OnClick="btnEditSStudentDocuments_Click" /&gt;
                                                                  &lt;/ContentTemplate&gt;
                                                              &lt;/asp:UpdatePanel&gt;
                                                          &lt;/ItemTemplate&gt;
                                                      &lt;/asp:TemplateField&gt;
                                                  &lt;/Columns&gt;
                                                  &lt;EmptyDataTemplate&gt;
                                                      no data.......
                                                  &lt;/EmptyDataTemplate&gt;
                                              &lt;/asp:GridView&gt;
                                          &lt;/ContentTemplate&gt;
                                      &lt;/asp:UpdatePanel&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                      &lt;/asp:Panel&gt;
                  &lt;/div&gt;
                  &lt;div style="width: 1000px; height: 40px; background-image: url('../../../PopU/bottom.png');
                      background-repeat: no-repeat;"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;asp:Button ID="hfbtnStudentDocumentIDShow" runat="server" OnClick="hfbtnStudentDocumentIDShow_Click"
      Style="display: none;" /&gt;
  &lt;Ajax:ModalPopupExtender ID="modal4" runat="server" PopupControlID="table4" CancelControlID="img3"
      TargetControlID="hfbtnStudentDocumentIDShow" OnCancelScript="javascript:__doPostBack('clearfields4')"&gt;
  &lt;/Ajax:ModalPopupExtender&gt;
  &lt;Ajax:AnimationExtender ID="AnimationExtender4" runat="server" TargetControlID="hfbtnStudentDocumentIDShow"&gt;
      &lt;Animations&gt;
            &lt;OnClick&gt;              
               &lt;Parallel AnimationTarget="table4"
                     Duration=".9" Fps="50"&gt;
                     &lt;FadeIn Duration=".9"/&gt;
               &lt;/Parallel&gt;                 
           &lt;/OnClick&gt;                                                                                                        
      &lt;/Animations&gt;
  &lt;/Ajax:AnimationExtender&gt;
  </code></pre>
  
  <p>Problem </p>
  
  <p><strong>When I click on link button it does not display any thing Please help me</strong></p>