Using the AJAX Web Forms in vs 2008 to develop the ASP.net program, you want to do a close window, as follows:
protected void Btndelete_click (object sender, EventArgs e)
{
int NID = convert.toint16 (request.querystring["ID"]);
Deleteweatherservices (NID);
Response.Write ("<script language=javascript>window.opener=null;self.close" (this); </script> ");
}
If you put the Btndelete button outside the UpdatePanel, you can normally close the window.
If you put the Btndelete button inside the UpdatePanel, you cannot close the window and prompt for an error:
Sys.WebForms.PageRequestManagerParserErrorException: Unable to parse the message received from the server. The common reason for an error occurs when you are calling
Response.Write () When the response is modified, the response filter, HttpModule, or server trace is enabled.
More information: An error occurred while parsing the "<script Language=jav" for the attachment
Workaround:
Scriptmanager.registerstartupscript (this. Updatepanel1,typeof (UpdatePanel), "CloseWindow", "<script language=javascript>window.opener=null;self.close (this); </script> ", false);
The true of that argument is that it automatically adds the mark "<script>" and "</script>"
False is to manually go to this tag yourself