![]() |
#2
wyalwy2010-12-27 19:29
|


protected void btnClose_Click(object sender, EventArgs e)
{
Page.Response.Write("<script language=javascript>window.close();location='javascript:history.go(-1)'</script>");
}
<body>
<form id="form1" runat="server">
<div align="center">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btnClose" runat="server" Style="position: relative" Text="关闭网页" OnClick="btnClose_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
{
Page.Response.Write("<script language=javascript>window.close();location='javascript:history.go(-1)'</script>");
}
<body>
<form id="form1" runat="server">
<div align="center">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btnClose" runat="server" Style="position: relative" Text="关闭网页" OnClick="btnClose_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
不知道这个问题怎么解决??? 怎么做才能在UpdatePanel区域执行Javascript代码!请各位指点........
[ 本帖最后由 wyalwy 于 2010-12-27 19:03 编辑 ]