title: How to close a UserControl after success button click in jquery asp.net?
body: <p>Hi iam using jquery in asp.net</p>
  
  <p>Ihave a user control with few contols and a SAVE button.</p>
  
  <p>Iam writing Ajax calls to save data .</p>
  
  <p>Iam getting my data saved Successfully. But after mu SUccess alert also my User Control Popup is still in the page. i just wanted to hide/close.</p>
  
  <p>For that i tried this code and was not working.</p>
  
  <pre><code>        success: function (html) {
                       try {
                           alert("added successfuly");
                           $(".modalBackground").hide();
                       } catch (ex) {
                           alert("ErrCode:1");
  
                       }
  </code></pre>
  
  <p>MY ASCX:</p>
  
  <p>WHich contains a ModalPopup with few fileds</p>
  
  <pre><code>     &lt;ajax:ModalPopupExtender ID="ModalPopupContext" runat="server" 
             TargetControlID="btnContextPopup" BehaviorID="ModalPopupExtender" PopupControlID="pnlpopupContext" BackgroundCssClass="modalBackground"&gt;
       &lt;/ajax:ModalPopupExtender&gt;
  
                   &lt;panel ....&gt;
  
                   TextBox1 
                   Textbox2
               &lt;asp:ImageButton ID="imgbtnUpdate" runat="server"       ClientIDMode="Static" CssClass="imgbtnUpdateADDContext" TabIndex="8" ImageUrl="~/image_repository/UpdateVoyage.png" /&gt;
          &lt;/panel&gt;
  </code></pre>
  
  <p>This is the Button which i use to save data., after this click if its success my UserControl Must be closed</p>