帮帮忙,有人回答这个问题吗
aaab2 2008-07-10 05:20:49 各位高手好,我是在一个框架页面里调用window.open()打开一个窗口A.aspx,我在A.aspx.cs文件里,点击一个button时用Response.Write(" <script language='javascript'>window.close();return false; </script>");语句想关闭窗口时,结果是A.aspx窗口放大了,而且也没被关闭,请大家指点。该段代码如下:
strSql = "Update Books Set Content='" + content + "' Where id = " + id;
cmd.CommandText = strSql;
cmd.Connection = myconn;
try
{
myconn.Open();
cmd.ExecuteNonQuery();
myconn.Close();
Response.Write(" <script language='javascript'>window.close();return false; </script>");
}
catch (Exception ex)
{
throw new Exception(ex.Message);
Response.Write(" <script language=javascript>alert('操作失败!'); </script>");
}