Hi,
I have a parent page that loads a popup and when the OK button is press it
pass the value back to the parent form textbox. It passes the value but it
doesn't close the popup but also open another copy of the popup. Guys I
checked everywhere. I get the same thing.
This is the code on the parent form webform1.aspx
HTML
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 240px; POSITION:
absolute; TOP: 144px" runat="server"
Text="Button"></asp:Button>
<asp:TextBox id="txtValue" style="Z-INDEX: 102; LEFT: 240px; POSITION:
absolute; TOP: 104px"
runat="server"></asp:TextBox>
</form>
</body>
VB CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog('child.aspx',null ,'status:no;dialogWidth:370px;dialogHeight:220px;d ialogHide:true;help:no;scroll:no');if
(strReturn != null) document.getElementById('txtValue').value=strRetur n;")
End Sub
This is the code for the child (popup) child.aspx
HTML
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:TextBox id="txtValue" style="Z-INDEX: 101; LEFT: 224px; POSITION:
absolute; TOP: 104px"
runat="server"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 224px; POSITION:
absolute; TOP: 144px" runat="server"
Text="Button"></asp:Button>
<asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 296px; POSITION:
absolute; TOP: 144px" runat="server"
Text="Button"></asp:Button>
</form>
</body>
VB CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.returnValue =
document.getElementById('txtValue').value; window.close();")
Button2.Attributes.Add("onclick", "window.close();")
End Sub
I would really appreciate any help on this. I gave it my best shot.
Thanks 3 1389
Hi Chris,
In your popup add a <head> tag like this:
<Head>
<BASE target="_self">
</Head>
The problem is that with out the target tag your popup will act funny when
it posts back to itself because it is Modal. Good luck! Ken.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try: http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com... Hi, I have a parent page that loads a popup and when the OK button is press it pass the value back to the parent form textbox. It passes the value but it doesn't close the popup but also open another copy of the popup. Guys I checked everywhere. I get the same thing.
This is the code on the parent form webform1.aspx
HTML
<body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 240px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> <asp:TextBox id="txtValue" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute; TOP: 104px" runat="server"></asp:TextBox> </form> </body> VB CODE Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog('child.aspx',null ,'status:no;dialogWidth:37
0px;dialogHeight:220px;dialogHide:true;help:no;scr oll:no');if (strReturn != null) document.getElementById('txtValue').value=strRetur n;")
End Sub
This is the code for the child (popup) child.aspx
HTML
<body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:TextBox id="txtValue" style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute; TOP: 104px" runat="server"></asp:TextBox> <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 224px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> <asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 296px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> </form> </body>
VB CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.returnValue = document.getElementById('txtValue').value; window.close();")
Button2.Attributes.Add("onclick", "window.close();") End Sub I would really appreciate any help on this. I gave it my best shot.
Thanks
Hi Chris,
I forgot, also do this, it doesn't look like you are even expecting to post
back, but you are:
Button1.Attributes.Add("onclick", "window.returnValue =
document.getElementById('txtValue').value; window.close(); return false;")
Button2.Attributes.Add("onclick", "window.close(); return false;")
Without the 'return false;', those buttons are causing a post back. Good
luck! Ken.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try: http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:OH*************@TK2MSFTNGP14.phx.gbl... Hi Chris,
In your popup add a <head> tag like this:
<Head> <BASE target="_self"> </Head>
The problem is that with out the target tag your popup will act funny when it posts back to itself because it is Modal. Good luck! Ken.
-- Ken Dopierala Jr. For great ASP.Net web hosting try: http://www.webhost4life.com/default.asp?refid=Spinlight If you sign up under me and need help, email me.
"Chris" <Ch***@discussions.microsoft.com> wrote in message news:71**********************************@microsof t.com... Hi, I have a parent page that loads a popup and when the OK button is press
it pass the value back to the parent form textbox. It passes the value but
it doesn't close the popup but also open another copy of the popup. Guys I checked everywhere. I get the same thing.
This is the code on the parent form webform1.aspx
HTML
<body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 240px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> <asp:TextBox id="txtValue" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute; TOP: 104px" runat="server"></asp:TextBox> </form> </body> VB CODE Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog('child.aspx',null ,'status:no;dialogWidth:37 0px;dialogHeight:220px;dialogHide:true;help:no;scr oll:no');if (strReturn != null)
document.getElementById('txtValue').value=strRetur n;") End Sub
This is the code for the child (popup) child.aspx
HTML
<body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:TextBox id="txtValue" style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute; TOP: 104px" runat="server"></asp:TextBox> <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 224px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> <asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 296px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> </form> </body>
VB CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.returnValue = document.getElementById('txtValue').value; window.close();")
Button2.Attributes.Add("onclick", "window.close();") End Sub I would really appreciate any help on this. I gave it my best shot.
Thanks
Once again I live to tell the tail! Thanks! Worked perfect.
Where can I find info on using these javascript with asp.net
"Ken Dopierala Jr." wrote: Hi Chris,
In your popup add a <head> tag like this:
<Head> <BASE target="_self"> </Head>
The problem is that with out the target tag your popup will act funny when it posts back to itself because it is Modal. Good luck! Ken.
-- Ken Dopierala Jr. For great ASP.Net web hosting try: http://www.webhost4life.com/default.asp?refid=Spinlight If you sign up under me and need help, email me.
"Chris" <Ch***@discussions.microsoft.com> wrote in message news:71**********************************@microsof t.com... Hi, I have a parent page that loads a popup and when the OK button is press it pass the value back to the parent form textbox. It passes the value but it doesn't close the popup but also open another copy of the popup. Guys I checked everywhere. I get the same thing.
This is the code on the parent form webform1.aspx
HTML
<body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 240px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> <asp:TextBox id="txtValue" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute; TOP: 104px" runat="server"></asp:TextBox> </form> </body> VB CODE Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", "var strReturn; strReturn=window.showModalDialog('child.aspx',null ,'status:no;dialogWidth:37 0px;dialogHeight:220px;dialogHide:true;help:no;scr oll:no');if (strReturn != null) document.getElementById('txtValue').value=strRetur n;")
End Sub
This is the code for the child (popup) child.aspx
HTML
<body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:TextBox id="txtValue" style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute; TOP: 104px" runat="server"></asp:TextBox> <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 224px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> <asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 296px; POSITION: absolute; TOP: 144px" runat="server" Text="Button"></asp:Button> </form> </body>
VB CODE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here
Button1.Attributes.Add("onclick", "window.returnValue = document.getElementById('txtValue').value; window.close();")
Button2.Attributes.Add("onclick", "window.close();") End Sub I would really appreciate any help on this. I gave it my best shot.
Thanks
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: CSDunn |
last post by:
Hello,
I need to create an Access 2003 ADP report that will require more
horizonal space on the report than can be accomodated by a legal paper
size in landscape orientation.
It would be okay...
|
by: VInay |
last post by:
Hi,
I am interested in checking is a sound is being played
using C#. Is it possible then how? Is any source code
available?
TIA,
Vinay
|
by: Vinay |
last post by:
Hi,
I want to verify if a particular song is being played
from my program. I have read a lot of examples of using
winmm.dll and importing PlaySound(). If there anyway to
check if a song is being...
|
by: Christine |
last post by:
erver Error in '/test' Application.
--------------------------------------------------------------------------------
There is not enough space on the disk.
Description: An unhandled exception...
|
by: alf |
last post by:
Hi,
I downloaded the latest found version and untared it - but can not find
any information how to install it. I guess it is boost based ...
Has any body played with it recently?
--
alf
| |
by: Mark C |
last post by:
How do you close windows media player in a web page after its played.
I have added a windows media player to my web page as:
<object id="Player"...
|
by: Frank |
last post by:
I've done this a few times.
In a solution I have a project, Say P1, and need another project that will
contain much code that is similar to that of P1.
I hope no one gets hung up on why I...
|
by: I Hate My Computer |
last post by:
I need help with some VB code. Ultimately I would like it in VBA because that's all I have. I am making a fun game to hide in all of my docs. It is a pong like game but you need to have your pad...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |