我在弹出窗口中有以下代码。我想在用户点击导出按钮
时关闭此弹出窗口Protected Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
Try
Dim sw As New StringWriter()
Dim w As New HtmlTextWriter(sw)
gv.RenderControl(w)
Dim content As String = sw.GetStringBuilder().ToString()
'I have generate pdf code here
'I want to close this popup
Catch ex As Exception
End Try
End Sub
答案 0 :(得分:1)
试试这个
ClientScript.RegisterStartupScript(GetType(), "winclose", "window.close();", true);
它生成客户端JavaScript,在呈现时将关闭当前窗口。