Open Popup Window and Close the window that Opened it

I'm using some code that I found on this site to open a Popup window with a Button Click for a Crystal Report:

Dim PopUpScript As String = "<script language='javascript'>" + "window.open(" & Chr(39) & strExportFile & Chr(39) & ");</script>"

Page.ClientScript.RegisterStartupScript(Me.GetType(), "PopUpWindow", PopUpScript, False)

After the Popup Window shows the Report I would like to close the window that opened this popup window.

 Thanks,

Mark

1
smithmrk
5/21/2008 3:48:37 PM
asp.net.web-forms 93655 articles. 3 followers. Follow

1 Replies
823 Views

Similar Articles

[PageSpeed] 29

just add

window.close();

in

Dim PopUpScript As String = "<script language='javascript'>" + "window.open(" & Chr(39) & strExportFile & Chr(39) & ");window.close();</script>"

I think it ask for promt before closing current window as this is inbuilt facility


Suyog
I am just using my free time,but if it helps you then my mark my post as answer
1
suyog
5/22/2008 10:52:37 AM
Reply:

Similar Artilces:

superreview granted: [Bug 263844] Javascript window.close() on popup not working when popup is opened in tab : [Attachment 162257] set opener on opened windows diverted into tabs
Boris Zbarsky <bzbarsky@mit.edu> has granted Boris Zbarsky <bzbarsky@mit.edu>'s request for superreview: Bug 263844: Javascript window.close() on popup not working when popup is opened in tab https://bugzilla.mozilla.org/show_bug.cgi?id=263844 Attachment 162257: set opener on opened windows diverted into tabs https://bugzilla.mozilla.org/attachment.cgi?id=162257&action=edit ------- Additional Comments from Boris Zbarsky <bzbarsky@mit.edu> r+sr=bzbarsky. Dan, thanks for doing this! I really wish we could factor some of this code that's being copied f...

window.open and window.opener
Sorry for a really dumb post. I am not a scripting person... I find the whole thing a bit strange really with losely coupled types ect...Anyway, I am putting together a ASP.NET v2 application. One of the pages I am planning on implementing a link to open a pop-up window. In this popup window, the user will select the location of somthing, the window close and the value returned back to one of the parent browsers controls. I know this is not rocket science and I have done endless searches to try and find the answer. I am loading up the page and passing in the ClientID of the control I wish to...

window.opener.closed return an permission denied error when opener window is closed.
There are two aspx pages, page1.aspx and page2.aspx.  There is an 'Open' button on page1, click this button, I open an separate browser window from which I open an separate browser window with url being page2.aspx.  Both pages are in same domain.On page2.aspx, every 5 seconds, it calls a javascript function that will check the "Closed" property of opener window. If the opener window is not closed, it return me false, which is correct. BUT if the opener window is closed, I am getting a permission denied Javascript runtime error.I am running the appli...

window.close() casuing popup window to hang when closing/opening again and again..
I have a parent window which opens a child window. the child window has a close button which I placed javascript code "window.close()" to close it. so i close the child window and re-open it again from the parent window ( around 3 times ). but suddenly my child window hangs... ( browser is up but loading...) any ideas?Alvin ShihSoftware DeveloperMCP MCTS MCPD can u give more detail??? i don't think that child window hanged... there shoud be any other problem. did u write some more javascript in child or parent window??? if yes then send it too... Looks like the same old memory leak is...

superreview cancelled: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225294] close blank window
Marria Nazif <marria@gmail.com> has cancelled Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225294: close blank window https://bugzilla.mozilla.org/attachment.cgi?id=225294&action=edit ...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225294] close blank window
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225294: close blank window https://bugzilla.mozilla.org/attachment.cgi?id=225294&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is a first try at closing the window after the external app handler has done its work. This se...

How to close current window when the popup window is open
 hi all,i need to close my current window when the popup is open.now i use data grid and iv call popup window in selected index chage event of that datagrid.but my current window is not close when popup was open.please tell me how i do this.thnks. I guess it depends on how you are opening the popup.  Here's an article that talks about doing this using javascript:http://blogs.x2line.com/al/articles/350.aspx  MarvinIf, by some rare and amazing chance, I suggested a solution that actually worked for you, please mark the post as "ANSWER" because, hey, I don&#...

How to send value form popup window to opener window ??
I have problem and I need everybody help me. I desgning a website using ASP.NET and VB.NET - I want, when user click button as show popup window with list user of system (from database) and click user of list, it's in textbox of opener window. Can you help me code it ??? Thanks a lot !!!  Không học không biết, học rồi sẽ biết  You have to access the window.opener.document object in JavaScript. This will give you access to the DOM. function getOpenerElem(Jb) { return window.opener.document.getElementById(Jb); }  I use this function to access the opening window...

maximize a window opened by window.open()
hi I want to allow the user to maximize the window opend by window.open() method sued in a ajax update panel ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.UpdatePanel1.GetType(), "NewClientScript", "window.open('help.aspx?','Report', 'width=500,height=400 ,top=210,left=505, scrollbars=yes');", true); Just have a look for this link it will give you all details in window.open() http://www.javascript-coder.com/window-popup/javascript-window-open.phtml   ...

window.open and window.opener problem
 Hi,I have written the following javascript to pop up a windowIn the parent page: function PreMail()     {       window.open("http://localhost:2704/WebSite3/popup1.aspx","popup1","height=50,width=300,left=500,top=400,status=no,toolbar=no,menubar=no,location=no");    }  and the button:<asp:Button ID="bt1" runat="server" OnClick="Button1_Click"  OnClientClick="PreMail()" Style="left: 45px;         &...

Open a new window with window.open()
Hi, =20 in our web application, we try to open a popup-window with window.open(). But instead of opening a new window, a new tab is opened. =20 In the SeaMonkey preferences, we configured it, to open new links in a new tab. With firefox, we had the same preferences, but when window.open() was called, a new window was opened.=20 How can we configure SeaMonkey, so that it has the Firefox behavior when calling window.open() ? =20 Thanks in advance. =20 =20 =20 Artur Zeiler schrieb: > Hi, > > in our web application, we try to open a popup-window wi...

window.open to open very small window
Hi, in Loggedoutmsg.aspx i am just writing- "YOU HAVE LOGGED OUT"newwin=window.open('Loggedoutmsg.aspx','Congrats',"location=0,status=0,scrollbars=0,width=300,height=1");  I want to open window just to show this line. But the window which gets opened by above code has hight more than necessary. Even when i specified height=1,its size not decreasing to show just one line .How can i do this? Please Mark the post as "ANSWER" if it helps you Answered here: http://forums.asp.net/t/1308177.aspx NC...   Heres something fro...

opening new window other than window.open
is there any other way of opening a new window... aside from window.open? window.open has a memory leak so i want to prevent using it as much as possible.Alvin ShihSoftware DeveloperMCP MCTS MCPD Hi window.showmodaldialog() but supports only IE....   Regards Suresh Kumar Goudampally Why dont you avoid pop up windows all together and use an iframe that is positioned over the content? Eric Pascarello.com | Twitter epascarello | LinkedIn Hi,Try Target="_blank" N.P.SenthilSoftware Engineer  Link buttons targer property is set to "_blank"...

how can I use window.opener but with window.showModalDialog instead of window.open
Hi, I tried the code bellow that I found in  :  4guysfromrolla site:the code displays a source page, whn I click on the Calendar <a href />  link  i get a calendar displayed on a target page. when I select a date, the calendar page closes and populates the textbox txtDate with the chosen date. Here is the code of the 2 pages and my question is down bellow:a source page called frmCalendar.aspx has this:<form name="frmCalendar">   <input name="txtDate" type="text" />   <a href=&q...

Web resources about - Open Popup Window and Close the window that Opened it - asp.net.web-forms

Window - Wikipedia, the free encyclopedia
This article is about the part of a building. For the Microsoft operating system, see Microsoft Windows . For other uses, see Window (disambiguation) ...

Microsoft Windows Information, Solutions, Tools - Windows IT Pro
Microsoft Windows information and solutions for IT pros. Topics include cloud computing, Windows Server, Exchange, Outlook, PowerShell, virtualization, ...

The Windows Blog
The Windows Blog is Microsoft's Official Blog for the Windows Operating System.

Microsoft To Only Support New Processors On Windows 10
... support news out of Redmond is particularly surprising. Intel launched it’s 6 th generation Skylake cores back in August, and support on Windows ...

Skylake users given 18 months to upgrade to Windows 10
... die shot. (credit: Intel) If you own a system with an Intel 6th generation Core processor—more memorably known as Skylake—and run Windows 7 ...

Microsoft gets aggressive after 18 months nextgen CPUs like Skylake will only support Windows 10
Microsoft's aggressive pushing of Windows 10 is becoming legendary, with everything from irritating nag screens, to automatic downloading of ...

The best ways to run Windows apps on your Mac without installing Windows
In 2016, you can do pretty much everything on a Mac that you can do on a Windows PC . But if there are Windows applications that you desperately ...

This guy's car was getting stolen — so he jumped through the window and took out the alleged thief
... was parked at a gas station. As soon the car's owner saw that his car was being stolen, he ran right back to it, leaped through the open window, ...

Survey says: Almost a third of U.S. consumers on Windows 10
U.S. consumers have fallen for Windows 10, according to a just-published survey done for researcher IDC, with a larger fraction of those polled ...

Microsoft Changes Its Mind, Decides To Nag Business Customers To Upgrade To Windows 10 After All
If you’ve been using Windows 7 or 8 on your personal computer, you’re likely well aware of Microsoft’s recent nagging campaign to get people ...

Resources last updated: 1/16/2016 2:07:31 PM