c# - How to close a UserControl after success button click in jquery asp.net? -


hi iam using jquery in asp.net

ihave user control few contols , save button.

iam writing ajax calls save data .

iam getting data saved successfully. after mu success alert user control popup still in page. wanted hide/close.

for tried code , not working.

        success: function (html) {                      try {                          alert("added successfuly");                          $(".modalbackground").hide();                      } catch (ex) {                          alert("errcode:1");                       } 

my ascx:

which contains modalpopup few fileds

     <ajax:modalpopupextender id="modalpopupcontext" runat="server"             targetcontrolid="btncontextpopup" behaviorid="modalpopupextender" popupcontrolid="pnlpopupcontext" backgroundcssclass="modalbackground">      </ajax:modalpopupextender>                   <panel ....>                   textbox1                   textbox2              <asp:imagebutton id="imgbtnupdate" runat="server"       clientidmode="static" cssclass="imgbtnupdateaddcontext" tabindex="8" imageurl="~/image_repository/updatevoyage.png" />         </panel> 

this button use save data., after click if success usercontrol must closed

try this:

success: function (html) {          try {               alert("port added successfuly");               $("panelclassname").hide(); // panel in ajax:modalpopupextender                              } catch (ex) {               alert("errcode:1");               }            return false;        } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -