从code身后关闭弹出窗口 [英] Close pop-up from code behind

查看:182
本文介绍了从code身后关闭弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个网站(包括我的控制范围之内)

I have two sites (both within my control)

网站1 - 打开网站2弹出要打开我有站点2弹出下面的

Dim strPopup As String = "<script language='javascript' ID='script1'>" + "window.open('" & http://site2.com/customer.aspx" & ",'pop', 'top=90, left=200, width=1000, height=800, dependant=no, location=0, alwaysRaised=no, menubar=no, resizeable=no, scrollbars=no, toolbar=no, status=no, center=yes')" + "</script>"

ScriptManager.RegisterStartupScript(DirectCast(HttpContext.Current.Handler, Page), GetType(Page), "Script1", strPopup, False)

注意:在'流行'在上面的code是按照我的理解方式的名称

Note: the 'pop' within the code above is the name of the form according to my understanding.

到目前为止,这正常工作。

So far this works as expected.

<青霉>网站2显示从上方和上有一个按钮,弹出。我想关闭弹出/窗口中打开上方,从而调整了上面的脚本,并将其添加到code按钮事件背后设有2 的

Dim strPopup As String = "<script language='javascript' ID='script1'>" + "window.close" + "</script>"

ScriptManager.RegisterStartupScript(DirectCast(HttpContext.Current.Handler, Page), GetType(Page), "Script1", strPopup, False)

但这并不工作。香港专业教育学院试图

but this doesnt work. Ive tried

pop.close (流行音乐是给窗体上的第一个code I张贴的名称)

pop.close (pop is the name given to the form on the first code i posted)

我有点失去了如何在背后code按钮事件内关闭打开的窗口中(弹出用户保存数据中,请注意,当他们点击这个按钮这样的想法是关闭该按钮一旦点击保存按钮)

I'm a little lost on how to close the open window within a button event in code behind (please note within the pop-up the user is saving data when they click this button so the idea is to close the button once they click the Save button)

推荐答案

window.close 是一个函数。您应该使用 window.close()的(圆brakets),而不是 window.close

window.close is a function. You should use window.close() (with round brakets) instead of window.close.

这篇关于从code身后关闭弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆