title: show/hide modalpopupextender inside updatepanel
body: <p>I have an asp.net page with ajax updatepanel and a grid. inside the same updatepanel, I have a modalpopupextender. I want to show modalpopupextender on click of the row button of grid.</p>
  
  <p>I have written this  js:</p>
  
  <pre><code>function AddRemoveFavorites(regId) {
  
              Showpopup();
              return false;
          }
  
          function Hidepopup() {
              $find('ModalPopupExtender1').hide();
          }
          //Function to Show ModalPopUp
          function Showpopup() {
              $find('ModalPopupExtender1').show();
          }
  </code></pre>
  
  <p>and here is markup for update panel, modalpopup and gridview button column. </p>
  
  <pre><code>&lt;asp:UpdatePanel ID="ResultUpdatePanel" runat="server" UpdateMode="Conditional"&gt;
              &lt;Triggers&gt;
                  &lt;asp:AsyncPostBackTrigger ControlID="SearchLinkButton" EventName="Click" /&gt;
                  &lt;asp:AsyncPostBackTrigger ControlID="SubmitButton" EventName="Click" /&gt;
              &lt;/Triggers&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt;
                  &lt;ajax:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="btnCancel"
                      OkControlID="btnOkay" TargetControlID="Button1" PopupControlID="Panel1" PopupDragHandleControlID="PopupHeader"
                      Drag="true" BackgroundCssClass="ModalPopupBG"&gt;
                  &lt;/ajax:ModalPopupExtender&gt;
                  &lt;asp:Panel ID="Panel1" Style="display: none" runat="server"&gt;
                      &lt;div class="HellowWorldPopup"&gt;
                          &lt;div class="PopupHeader" id="PopupHeader"&gt;
                              Header&lt;/div&gt;
                          &lt;div class="PopupBody"&gt;
                              &lt;p&gt;
                                  This is a simple modal dialog&lt;/p&gt;
                          &lt;/div&gt;
                          &lt;div class="Controls"&gt;
                              &lt;input id="btnOkay" type="button" value="Done" /&gt;
                              &lt;input id="btnCancel" type="button" value="Cancel" /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>and grid column</p>
  
  <pre><code> &lt;asp:TemplateField HeaderStyle-CssClass="gridTitleCor2" ItemStyle-CssClass="GridBorderR"
                              ItemStyle-Wrap="false"&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:PlaceHolder ID="SavedPH" runat="server" Visible='&lt;%# Eval("IsSaved").ToString() == "1" %&gt;'&gt;
                                      &lt;a href='#' onclick='AddRemoveFavorites(&lt;%# Eval("RegistrantID").ToString() %&gt;); return false;'
                                          title="&lt;%= Resources.UserProfile.C_SerRes_RemoveFavorites %&gt;"&gt;
                                          &lt;img id='&lt;%# String.Format("StatusImage_{0}", Eval("RegistrantID").ToString()) %&gt;'
                                              src="/Images/StarYellow.png" /&gt;
                                      &lt;/a&gt;&lt;/asp:PlaceHolder&gt;
                                  &lt;asp:PlaceHolder ID="NotSavedPH" runat="server" Visible='&lt;%# Eval("IsSaved").ToString() == "0" %&gt;'&gt;
                                      &lt;a href='#' onclick='AddRemoveFavorites(&lt;%# Eval("RegistrantID").ToString() %&gt;); return false;'
                                          title="&lt;%= Resources.UserProfile.C_SerRes_AddFavorites %&gt;"&gt;
                                          &lt;img id='&lt;%# String.Format("StatusImage_{0}", Eval("RegistrantID").ToString()) %&gt;'
                                              src="/Images/StarGrey.png" /&gt;
                                      &lt;/a&gt;&lt;/asp:PlaceHolder&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>
          </p>
  
  <p>but I am getting following error:</p>
  
  <pre><code>Uncaught TypeError: Cannot call method 'show' of null 
  </code></pre>