-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: bobby_kedia
Message 2 in Discussion
New Message on MumbaiUserGroup
JavaScript Window.ShowModalDialog
Reply
Reply to Sender
Recommend
Message 1 in Discussion
From:
bobby_kedia
I am facing a problem. Whenever i close a child window by a click event on a
button inside child window, it closes the child window and opens a new window ,
instead of giving focus to parent window.
Returning value from the dialog box
See the code below.
parent.aspx
child.aspx
Parent web form will have one textbox and a button. Look at the following code
of the parent web form.
parent.aspx <body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:TextBox id="txtValue" style="Z-INDEX: 101; LEFT: 16px; POSITION:
absolute; TOP: 24px" runat="server"></asp:TextBox>
<asp:Button id="btnOpen" style="Z-INDEX: 102; LEFT: 176px; POSITION:
absolute; TOP: 24px" runat="server" Text="Open..."></asp:Button>
</form>
</body>
parent.aspx.vb Private Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
btnOpen.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog('child2.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');if
(strReturn != null) document.getElementById('txtValue').value=strReturn;")
End Sub
And, child web form which will have a textbox and two buttons. Look at the
following code of the child page.
child2.aspx <body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:TextBox id="txtValue" style="Z-INDEX: 101; LEFT: 16px; POSITION:
absolute; TOP: 24px" runat="server"></asp:TextBox>
<asp:Button id="btnOK" style="Z-INDEX: 103; LEFT: 48px; POSITION: absolute;
TOP: 56px" runat="server" Text="Ok" Width="56px"></asp:Button>
<asp:Button id="btnCancel" style="Z-INDEX: 102; LEFT: 112px; POSITION:
absolute; TOP: 56px" runat="server" Text="Cancel"></asp:Button>
</form>
</body>
child2.aspx.vb
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
btnOK.Attributes.Add("onclick", "window.returnValue =
document.getElementById('txtValue').value; window.close();")
btnCancel.Attributes.Add("onclick", "window.close();")
End Sub
View other groups in this category.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]