单击同一页面上的按钮,关闭弹出窗口 [英] closing the popup on clicking the button which is in the same page

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

问题描述

我有一个Default.aspx页面,其中有一个图像.
单击该图像后,将打开一个弹出窗口.
该弹出窗口是一个aspx页面(submitForm.aspx),该页面具有一个ascx页面(submitform.ascx).该asxc页面具有以下形式的编码和设计:

现在的问题是,当我单击该图像时,将出现一个弹出窗口,该弹出窗口是提交pdf在新窗口中打开的表单时的注册表单.

我想要的是当pdf在新窗口中打开时,弹出窗口应关闭

这是打开pdf的代码

I have a Default.aspx page in which i have an image.
on click of that image, a popup opens.
that popup is an aspx page(submitForm.aspx) which has an ascx page(submitform.ascx) this asxc page has the coding and design of the form

Now the issue is when i click that image, a popup appears which is a registration form on submiting the form a pdf opens in a new window

what i want is when the pdf opens in a new window the popup should close

this is code to open the pdf

ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open('http://www.ilink-systems.com/Portals/0/ilink/pdf/chempoint-v2.pdf', null, 'height=600,width=900,status=yes,toolbar=no,menubar=no,location=no' );", true);



当我单击ascx页面中的提交"按钮时,应先打开pdf文件,然后关闭弹出窗口,反之亦然.

这是我试图关闭弹出窗口的代码



when i click the submit button in the ascx page, first pdf should open and then the popup should close or vise versa.

this is the code i tried to close the popup

Page.ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.close();", true);



所有的编码和设计都在单击提交按钮的ascx页面中,我必须在新窗口中打开pdf并关闭弹出式窗口(submitForm.xspx).

请帮助我....



all the coding and design is in the ascx page on clicking the submit button i have to open the pdf in new window and close the popup that is(submitForm.xspx).

please help me....

推荐答案

您可以在重新注册pdf文件脚本后使用window.close();



you can use window.close(); after registring your pdf file script

i.e.

ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open('http://www.ilink-systems.com/Portals/0/ilink/pdf/chempoint-v2.pdf', null, 'height=600,width=900,status=yes,toolbar=no,menubar=no,location=no' );window.close();", true);


这篇关于单击同一页面上的按钮,关闭弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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