Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

JavaScript
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);


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

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


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....
Posted
Updated 15-May-12 19:18pm
v2
Comments
Sandeep Mewara 16-May-12 1:34am    
Is is that you want to have only one popup window at a time + no need to access parent page as long as popup is there?

1 solution

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

i.e.

HTML
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);
 
Share this answer
 
v2
Comments
M.Ravibalaji 16-May-12 1:05am    
i will make it clear an aspx page and an ascx page are there

i have done the design and coding in ascx page and registered it in aspx page

now when i click the botton the aspx page should close(so that registered ascx page will also be closed because it is put in an aspx page)

i think now u understand my problem clearly.....

the code u gave is not working i tried it...

help me with some other code...
Technoses 16-May-12 12:34pm    
first i clear you that ascx is not a page . it is a user control so it can not run directly. second tell me what happens when you write this code...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900