Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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);
 
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
Edited 15-May-12 19:18pm
v2
Comments
Sandeep Mewara at 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
good
Please Sign up or sign in to vote.

Solution 1

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);
  Permalink  
v2
Comments
M.Ravibalaji at 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 at 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
0 Maciej Los 245
1 OriginalGriff 210
2 Manfred R. Bihy 190
3 CHill60 180
4 _Amy 155
0 OriginalGriff 7,445
1 Sergey Alexandrovich Kryukov 6,157
2 Maciej Los 3,774
3 Peter Leow 3,448
4 CHill60 2,702


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 16 May 2012
Copyright © CodeProject, 1999-2014
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