Click here to Skip to main content
13,199,318 members (75,754 online)
Rate this:
Please Sign up or sign in to vote.
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

ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "'', 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

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 15-May-12 18:46pm
Updated 15-May-12 19:18pm
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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


ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "'', null, 'height=600,width=900,status=yes,toolbar=no,menubar=no,location=no' );window.close();", true);
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171020.1 | Last Updated 16 May 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100