•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,950 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,165 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5190 | Replies: 1
![]() |
•
•
Join Date: Mar 2006
Posts: 18
Reputation:
Rep Power: 3
Solved Threads: 0
Hi,
I have an ASP.NET application that will not close a Browser using the Javascript Window.Close() command.
I am opening a Browser on top of the current Browser to display and collect additional information. In the Click event of the command button on the pop-up Browser, I execute some VB.NET code prior to calling the javascript Window.Close() command. This works fine for three workstations in the office, but two workstations will execute the VB.NET code, but will not close the Browser, even clicking the X in the browser window will not close the pop-up Browser on these two workstations. They just hang. The Internet Options appear to be identical on all the workstations in the office. All the workstations are using Internet Explorer 6.0. Does anyone have any ideas as to why the pop-up Browser will not close on these two workstations?
Thanks,
Mike
I have an ASP.NET application that will not close a Browser using the Javascript Window.Close() command.
I am opening a Browser on top of the current Browser to display and collect additional information. In the Click event of the command button on the pop-up Browser, I execute some VB.NET code prior to calling the javascript Window.Close() command. This works fine for three workstations in the office, but two workstations will execute the VB.NET code, but will not close the Browser, even clicking the X in the browser window will not close the pop-up Browser on these two workstations. They just hang. The Internet Options appear to be identical on all the workstations in the office. All the workstations are using Internet Explorer 6.0. Does anyone have any ideas as to why the pop-up Browser will not close on these two workstations?
Thanks,
Mike
•
•
Join Date: Dec 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi man i will post this to help you in the situation
Here's the code for the parent page:
And, here's the code for the child "Popup" page:
Here's the code for the parent page:
asp.net Syntax (Toggle Plain Text)
[color=blue]public[/color] [color=blue]class[/color] Default : Page { [color=blue]protected[/color] TextBox txtFirstName; [color=blue]protected[/color] TextBox txtLastName; [color=blue]protected[/color] Label Label1; [color=blue]protected[/color] Label Label2; [color=blue]protected[/color] HyperLink HyperLink1; [color=blue]private[/color] [color=blue]void[/color] Page_Load([color=blue]object[/color] sender, EventArgs e) { [color=green]//create our update function[/color] [color=blue]string[/color] scr = @"<script> function update(elemValue) { document.getElementById('txtFirstName').innerText=elemValue[0]; document.getElementById('txtLastName').innerText=elemValue[1]; } </script>"; [color=green]// register the javascript into the Page[/color] Page.RegisterClientScriptBlock("update", scr); [color=green]//add our popup onclick attribute to the desired element on the page (Here, Hyperlink1)[/color] HyperLink1.Attributes.Add("onclick", "window.open('popup.aspx',null,'left=400, top=100, height=250, width= 250, status=n o, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');"); }
And, here's the code for the child "Popup" page:
asp.net Syntax (Toggle Plain Text)
[color=blue]public[/color] [color=blue]class[/color] popup : System.Web.UI.Page { [color=blue]protected[/color] System.Web.UI.WebControls.TextBox TextBox1; [color=blue]protected[/color] System.Web.UI.WebControls.Label Label2; [color=blue]protected[/color] System.Web.UI.WebControls.TextBox txtLastName; [color=blue]protected[/color] System.Web.UI.WebControls.TextBox txtFirstName; [color=blue]protected[/color] System.Web.UI.WebControls.Label Label1; [color=blue]private[/color] [color=blue]void[/color] Page_Load([color=blue]object[/color] sender, System.EventArgs e) { [color=blue]string[/color] scr= @"<script> function Done() { var fName=document.getElementById('txtFirstName').value; var lName=document.getElementById('txtLastName').value; var ret= new Array(fName,lName); window.opener.update(ret); window.close(); } </script>;"; Page.RegisterClientScriptBlock("done", scr); }
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax apple asp beta bon browser code combo custom data development dom dropdownlist echo email encryption feed firefox internet microsoft mobile module mozilla msdn net news nintendo patch pda privacy reuse safari security skin software spoof sql testing theme url weather web webmail windows windows workflow xml xoap
- problem IE (runonce) has taken over my browser (DaniWeb Community Feedback)
- Internet Explorer multiple windows problem - XP (Web Browsers)
- new window popup (HTML and CSS)
- window.close() not working in flash MX??? (Graphics and Multimedia)
- Formac Studio Remote (Mac Software)
- IE 6.0 browser window closes on submit (Web Browsers)
- closing a window (Java)
Other Threads in the ASP.NET Forum
- Previous Thread: Getting values from GridView Controls
- Next Thread: Unwanted data injected into datagrid textbox


Linear Mode