Home All Groups Group Topic Archive Search About

Retrieve a value from a PopUp

Author
5 Sep 2006 7:22 AM
Patricio
Hello all
I open a PopUp that receives two variables (values).  This PopUp must return
a value as well.
How can I retrieve this value?

Thanks a lot.

Author
5 Sep 2006 8:43 AM
Eliyahu Goldin
How do you open it and do you pass the values to it?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Show quote
"Patricio" <PatricioOrt***@latinamil.com> wrote in message
news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
> Hello all
> I open a PopUp that receives two variables (values).  This PopUp must
> return a value as well.
> How can I retrieve this value?
>
> Thanks a lot.
>
Author
5 Sep 2006 8:24 AM
Patricio
Hi

Dim CustomID As String = TB_ID.Text

Dim variable1 As String = TB_SearchBenef.Text

Dim str1 As String = "<script
language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
& CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
""",""_new"",""height=500,width=" & Ancho &
",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"

Page.ClientScript.RegisterStartupScript(Me.GetType(), "History_script",
str1)



Thanks

Show quote
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
> How do you open it and do you pass the values to it?
>
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]
>
>
> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>> Hello all
>> I open a PopUp that receives two variables (values).  This PopUp must
>> return a value as well.
>> How can I retrieve this value?
>>
>> Thanks a lot.
>>
>
>
Author
5 Sep 2006 9:01 AM
Laurent Bugnion
Hi,

Patricio wrote:
Show quote
> Hi
>
> Dim CustomID As String = TB_ID.Text
>
> Dim variable1 As String = TB_SearchBenef.Text
>
> Dim str1 As String = "<script
> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
> """,""_new"",""height=500,width=" & Ancho &
> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>
> Page.ClientScript.RegisterStartupScript(Me.GetType(), "History_script",
> str1)

One possibility is to use the JavaScript "opener" property in the Window
object to call a method.

Example (in the popup):

if ( self.opener
   && self.opener.setValues )
{
   self.opener.setValues( value1, value2 );
}

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Author
5 Sep 2006 10:04 AM
Eliyahu Goldin
A page opened with a window.open gets a reference to the page that opened it
in window.opener property. You can call javascript functions as

window.opener.setPopupResults ("ok");

where setPopupResults is a javascript function you can write for accepting
string  values from the popup.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Show quote
"Patricio" <PatricioOrt***@latinamil.com> wrote in message
news:uYpu9SM0GHA.4264@TK2MSFTNGP05.phx.gbl...
> Hi
>
> Dim CustomID As String = TB_ID.Text
>
> Dim variable1 As String = TB_SearchBenef.Text
>
> Dim str1 As String = "<script
> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
> """,""_new"",""height=500,width=" & Ancho &
> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>
> Page.ClientScript.RegisterStartupScript(Me.GetType(), "History_script",
> str1)
>
>
>
> Thanks
>
> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
> message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
>> How do you open it and do you pass the values to it?
>>
>> --
>> Eliyahu Goldin,
>> Software Developer & Consultant
>> Microsoft MVP [ASP.NET]
>>
>>
>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>>> Hello all
>>> I open a PopUp that receives two variables (values).  This PopUp must
>>> return a value as well.
>>> How can I retrieve this value?
>>>
>>> Thanks a lot.
>>>
>>
>>
>
>
Author
5 Sep 2006 1:28 PM
Patricio
Thanks a lot
I need to call a VB function. It's possible?
-

Show quote
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
message news:u6zDQqM0GHA.4408@TK2MSFTNGP05.phx.gbl...
>A page opened with a window.open gets a reference to the page that opened
>it in window.opener property. You can call javascript functions as
>
> window.opener.setPopupResults ("ok");
>
> where setPopupResults is a javascript function you can write for accepting
> string  values from the popup.
>
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]
>
>
> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
> news:uYpu9SM0GHA.4264@TK2MSFTNGP05.phx.gbl...
>> Hi
>>
>> Dim CustomID As String = TB_ID.Text
>>
>> Dim variable1 As String = TB_SearchBenef.Text
>>
>> Dim str1 As String = "<script
>> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
>> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
>> """,""_new"",""height=500,width=" & Ancho &
>> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>>
>> Page.ClientScript.RegisterStartupScript(Me.GetType(), "History_script",
>> str1)
>>
>>
>>
>> Thanks
>>
>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>> message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
>>> How do you open it and do you pass the values to it?
>>>
>>> --
>>> Eliyahu Goldin,
>>> Software Developer & Consultant
>>> Microsoft MVP [ASP.NET]
>>>
>>>
>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>>>> Hello all
>>>> I open a PopUp that receives two variables (values).  This PopUp must
>>>> return a value as well.
>>>> How can I retrieve this value?
>>>>
>>>> Thanks a lot.
>>>>
>>>
>>>
>>
>>
>
>
Author
5 Sep 2006 3:32 PM
Eliyahu Goldin
Yes.

From javascript function  setPopupResults you will need to call
myForm.submit(). This will fire a postback to the server. On the server side
you can call your VB function.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Show quote
"Patricio" <PatricioOrt***@latinamil.com> wrote in message
news:%23PlJw8O0GHA.3512@TK2MSFTNGP04.phx.gbl...
> Thanks a lot
> I need to call a VB function. It's possible?
> -
>
> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
> message news:u6zDQqM0GHA.4408@TK2MSFTNGP05.phx.gbl...
>>A page opened with a window.open gets a reference to the page that opened
>>it in window.opener property. You can call javascript functions as
>>
>> window.opener.setPopupResults ("ok");
>>
>> where setPopupResults is a javascript function you can write for
>> accepting string  values from the popup.
>>
>> --
>> Eliyahu Goldin,
>> Software Developer & Consultant
>> Microsoft MVP [ASP.NET]
>>
>>
>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>> news:uYpu9SM0GHA.4264@TK2MSFTNGP05.phx.gbl...
>>> Hi
>>>
>>> Dim CustomID As String = TB_ID.Text
>>>
>>> Dim variable1 As String = TB_SearchBenef.Text
>>>
>>> Dim str1 As String = "<script
>>> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
>>> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
>>> """,""_new"",""height=500,width=" & Ancho &
>>> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>>>
>>> Page.ClientScript.RegisterStartupScript(Me.GetType(), "History_script",
>>> str1)
>>>
>>>
>>>
>>> Thanks
>>>
>>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>>> message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
>>>> How do you open it and do you pass the values to it?
>>>>
>>>> --
>>>> Eliyahu Goldin,
>>>> Software Developer & Consultant
>>>> Microsoft MVP [ASP.NET]
>>>>
>>>>
>>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>>> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>>>>> Hello all
>>>>> I open a PopUp that receives two variables (values).  This PopUp must
>>>>> return a value as well.
>>>>> How can I retrieve this value?
>>>>>
>>>>> Thanks a lot.
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
5 Sep 2006 3:01 PM
Patricio
Sorry for disturb you but I have this error message:
Microsoft JScript runtime error: 'window.opener.parent.form1' is null or not
an object
Where is the problem?

Thanks

Show quote
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
message news:%23NyiKhP0GHA.5048@TK2MSFTNGP05.phx.gbl...
> Yes.
>
> From javascript function  setPopupResults you will need to call
> myForm.submit(). This will fire a postback to the server. On the server
> side you can call your VB function.
>
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]
>
>
> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
> news:%23PlJw8O0GHA.3512@TK2MSFTNGP04.phx.gbl...
>> Thanks a lot
>> I need to call a VB function. It's possible?
>> -
>>
>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>> message news:u6zDQqM0GHA.4408@TK2MSFTNGP05.phx.gbl...
>>>A page opened with a window.open gets a reference to the page that opened
>>>it in window.opener property. You can call javascript functions as
>>>
>>> window.opener.setPopupResults ("ok");
>>>
>>> where setPopupResults is a javascript function you can write for
>>> accepting string  values from the popup.
>>>
>>> --
>>> Eliyahu Goldin,
>>> Software Developer & Consultant
>>> Microsoft MVP [ASP.NET]
>>>
>>>
>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>> news:uYpu9SM0GHA.4264@TK2MSFTNGP05.phx.gbl...
>>>> Hi
>>>>
>>>> Dim CustomID As String = TB_ID.Text
>>>>
>>>> Dim variable1 As String = TB_SearchBenef.Text
>>>>
>>>> Dim str1 As String = "<script
>>>> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
>>>> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
>>>> """,""_new"",""height=500,width=" & Ancho &
>>>> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>>>>
>>>> Page.ClientScript.RegisterStartupScript(Me.GetType(), "History_script",
>>>> str1)
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>>>> message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
>>>>> How do you open it and do you pass the values to it?
>>>>>
>>>>> --
>>>>> Eliyahu Goldin,
>>>>> Software Developer & Consultant
>>>>> Microsoft MVP [ASP.NET]
>>>>>
>>>>>
>>>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>>>> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>>>>>> Hello all
>>>>>> I open a PopUp that receives two variables (values).  This PopUp must
>>>>>> return a value as well.
>>>>>> How can I retrieve this value?
>>>>>>
>>>>>> Thanks a lot.
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
5 Sep 2006 4:15 PM
Eliyahu Goldin
First of all, I strongly recommend to encapsulate all the functionality you
want to invoke inside one javascript function. By doing this you will
concentrate all operations internal to the calling page inside the calling
page.

As far as the error is concerned, the "parent" part might be not needed.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Show quote
"Patricio" <PatricioOrt***@latinamil.com> wrote in message
news:uXVApwP0GHA.3464@TK2MSFTNGP03.phx.gbl...
> Sorry for disturb you but I have this error message:
> Microsoft JScript runtime error: 'window.opener.parent.form1' is null or
> not an object
> Where is the problem?
>
> Thanks
>
> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
> message news:%23NyiKhP0GHA.5048@TK2MSFTNGP05.phx.gbl...
>> Yes.
>>
>> From javascript function  setPopupResults you will need to call
>> myForm.submit(). This will fire a postback to the server. On the server
>> side you can call your VB function.
>>
>> --
>> Eliyahu Goldin,
>> Software Developer & Consultant
>> Microsoft MVP [ASP.NET]
>>
>>
>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>> news:%23PlJw8O0GHA.3512@TK2MSFTNGP04.phx.gbl...
>>> Thanks a lot
>>> I need to call a VB function. It's possible?
>>> -
>>>
>>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>>> message news:u6zDQqM0GHA.4408@TK2MSFTNGP05.phx.gbl...
>>>>A page opened with a window.open gets a reference to the page that
>>>>opened it in window.opener property. You can call javascript functions
>>>>as
>>>>
>>>> window.opener.setPopupResults ("ok");
>>>>
>>>> where setPopupResults is a javascript function you can write for
>>>> accepting string  values from the popup.
>>>>
>>>> --
>>>> Eliyahu Goldin,
>>>> Software Developer & Consultant
>>>> Microsoft MVP [ASP.NET]
>>>>
>>>>
>>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>>> news:uYpu9SM0GHA.4264@TK2MSFTNGP05.phx.gbl...
>>>>> Hi
>>>>>
>>>>> Dim CustomID As String = TB_ID.Text
>>>>>
>>>>> Dim variable1 As String = TB_SearchBenef.Text
>>>>>
>>>>> Dim str1 As String = "<script
>>>>> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
>>>>> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
>>>>> """,""_new"",""height=500,width=" & Ancho &
>>>>> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>>>>>
>>>>> Page.ClientScript.RegisterStartupScript(Me.GetType(),
>>>>> "History_script", str1)
>>>>>
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>>>>> message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
>>>>>> How do you open it and do you pass the values to it?
>>>>>>
>>>>>> --
>>>>>> Eliyahu Goldin,
>>>>>> Software Developer & Consultant
>>>>>> Microsoft MVP [ASP.NET]
>>>>>>
>>>>>>
>>>>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>>>>> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>>>>>>> Hello all
>>>>>>> I open a PopUp that receives two variables (values).  This PopUp
>>>>>>> must return a value as well.
>>>>>>> How can I retrieve this value?
>>>>>>>
>>>>>>> Thanks a lot.
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
6 Sep 2006 7:08 AM
Patricio
Thanks

Show quote
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
message news:uGV$Q5P0GHA.3568@TK2MSFTNGP03.phx.gbl...
> First of all, I strongly recommend to encapsulate all the functionality
> you want to invoke inside one javascript function. By doing this you will
> concentrate all operations internal to the calling page inside the calling
> page.
>
> As far as the error is concerned, the "parent" part might be not needed.
>
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]
>
>
> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
> news:uXVApwP0GHA.3464@TK2MSFTNGP03.phx.gbl...
>> Sorry for disturb you but I have this error message:
>> Microsoft JScript runtime error: 'window.opener.parent.form1' is null or
>> not an object
>> Where is the problem?
>>
>> Thanks
>>
>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>> message news:%23NyiKhP0GHA.5048@TK2MSFTNGP05.phx.gbl...
>>> Yes.
>>>
>>> From javascript function  setPopupResults you will need to call
>>> myForm.submit(). This will fire a postback to the server. On the server
>>> side you can call your VB function.
>>>
>>> --
>>> Eliyahu Goldin,
>>> Software Developer & Consultant
>>> Microsoft MVP [ASP.NET]
>>>
>>>
>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>> news:%23PlJw8O0GHA.3512@TK2MSFTNGP04.phx.gbl...
>>>> Thanks a lot
>>>> I need to call a VB function. It's possible?
>>>> -
>>>>
>>>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>>>> message news:u6zDQqM0GHA.4408@TK2MSFTNGP05.phx.gbl...
>>>>>A page opened with a window.open gets a reference to the page that
>>>>>opened it in window.opener property. You can call javascript functions
>>>>>as
>>>>>
>>>>> window.opener.setPopupResults ("ok");
>>>>>
>>>>> where setPopupResults is a javascript function you can write for
>>>>> accepting string  values from the popup.
>>>>>
>>>>> --
>>>>> Eliyahu Goldin,
>>>>> Software Developer & Consultant
>>>>> Microsoft MVP [ASP.NET]
>>>>>
>>>>>
>>>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>>>> news:uYpu9SM0GHA.4264@TK2MSFTNGP05.phx.gbl...
>>>>>> Hi
>>>>>>
>>>>>> Dim CustomID As String = TB_ID.Text
>>>>>>
>>>>>> Dim variable1 As String = TB_SearchBenef.Text
>>>>>>
>>>>>> Dim str1 As String = "<script
>>>>>> language=""javascript"">windowname=window.open(""Customer_history.aspx?CustomID1="
>>>>>> & CustomID & "&Flag_aux=" & Flag1 & "&Variable1=" & variable1 &
>>>>>> """,""_new"",""height=500,width=" & Ancho &
>>>>>> ",top=50,left=100,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no"");</script>"
>>>>>>
>>>>>> Page.ClientScript.RegisterStartupScript(Me.GetType(),
>>>>>> "History_script", str1)
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldD***@mMvVpPsS.org> wrote in
>>>>>> message news:%23Zpn08L0GHA.720@TK2MSFTNGP02.phx.gbl...
>>>>>>> How do you open it and do you pass the values to it?
>>>>>>>
>>>>>>> --
>>>>>>> Eliyahu Goldin,
>>>>>>> Software Developer & Consultant
>>>>>>> Microsoft MVP [ASP.NET]
>>>>>>>
>>>>>>>
>>>>>>> "Patricio" <PatricioOrt***@latinamil.com> wrote in message
>>>>>>> news:Oq6LewL0GHA.1304@TK2MSFTNGP05.phx.gbl...
>>>>>>>> Hello all
>>>>>>>> I open a PopUp that receives two variables (values).  This PopUp
>>>>>>>> must return a value as well.
>>>>>>>> How can I retrieve this value?
>>>>>>>>
>>>>>>>> Thanks a lot.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
5 Sep 2006 12:35 PM
tweety
Patricio wrote:

> Hello all
> I open a PopUp that receives two variables (values).  This PopUp must return
> a value as well.
> How can I retrieve this value?
>
> Thanks a lot.

by using QueryString you pass a value from popup to aspx page
Author
5 Sep 2006 12:42 PM
Laurent Bugnion
Hi,

tweety wrote:
> Patricio wrote:
>
>> Hello all
>> I open a PopUp that receives two variables (values).  This PopUp must return
>> a value as well.
>> How can I retrieve this value?
>>
>> Thanks a lot.
>
> by using QueryString you pass a value from popup to aspx page

That will force a postback on the main page.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

AddThis Social Bookmark Button