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
|