Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2006, 06:26 AM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default I can open a new window but can't close it

Hi all,

i m just wondering, waht i m doing wrong!!
I am working with VS2005 And IE.

What I Need:

I need a button1 in a parent form, when the user clicks, he gets a new child window with a text box. He can input some data and press ok, or cancel. after that, the child window closes and i proceed in the parent window.

What I did:

in the parent form, in the Page_onload:

Button.Attributes.Add("onclick",
"var strReturn; strReturn=window.showModalDialog('Windows_Child.as px',null,'status:no;dialogWidth:370px;dialogHeight :220px;dialogHide:true;help:no;scroll:no');if (strReturn != null) document.getElementById('TextBox1').value=strRetur n;")

in the child form, in the Page_onload:

btnOK.Attributes.Add("onclick", "window.returnValue = document.getElementById('txtValue').value; window.close();")

btnCancel.Attributes.Add("onclick", "window.close();")


my Problem:

when i press a button from my Child form, I get my Child Page in a new normal Browser window!?? :-(


What am I missing?

Thanks for any help






Similar Threads
Thread Thread Starter Forum Replies Last Post
Window.close muthuprakash83 Javascript How-To 0 August 7th, 2006 12:35 PM
window.close() failing to...well...close! mheathcote Javascript How-To 2 October 31st, 2005 03:02 PM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM
close window.showModalDialog chopswil Javascript How-To 1 September 30th, 2003 09:09 AM
How do i close pop-up window?: window.close () Burton HTML Code Clinic 2 September 8th, 2003 05:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.