Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > I have played enough with this. I need help.

Reply
Thread Tools

I have played enough with this. I need help.

 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      11-11-2004
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


 
Reply With Quote
 
 
 
 
Ken Dopierala Jr.
Guest
Posts: n/a
 
      11-11-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Ken Dopierala Jr.
Guest
Posts: n/a
 
      11-11-2004
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      11-11-2004
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Enough is enough! I have had it with .... Evan Platt Computer Support 1 08-04-2009 12:04 AM
Thegreatest game I have and will probably ever played. runescapeize Computer Support 1 09-25-2007 06:23 PM
Multimedia files have green screen when played. Ray Donzdorf Computer Support 4 07-03-2006 01:11 AM
Is the sport of Eddierox baiting only played at weekends or can it be played during the week? Typh0n MCSE 67 04-07-2004 12:40 AM
dvd's from e80h have some distortion when played on PC readers news.bellatlantic.net DVD Video 1 12-04-2003 11:41 AM



Advertisments