Retrieve a value from a PopUp

  • Thread starter Thread starter Patricio
  • Start date Start date
P

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.
 
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 said:
How do you open it and do you pass the values to it?

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


Patricio said:
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.
 
Hi,
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
 
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 said:
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 said:
How do you open it and do you pass the values to it?

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


Patricio said:
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.
 
Patricio said:
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
 
Thanks a lot
I need to call a VB function. It's possible?
-

Eliyahu Goldin said:
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 said:
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 said:
How do you open it and do you pass the values to it?

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


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.
 
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 said:
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 said:
Thanks a lot
I need to call a VB function. It's possible?
-

Eliyahu Goldin said:
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]


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

message How do you open it and do you pass the values to it?

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


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.
 
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 said:
Thanks a lot
I need to call a VB function. It's possible?
-

Eliyahu Goldin said:
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 said:
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

message How do you open it and do you pass the values to it?

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


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.
 
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 said:
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 said:
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 said:
Thanks a lot
I need to call a VB function. It's possible?
-

message 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]


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

message How do you open it and do you pass the values to it?

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


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.
 
Thanks

Eliyahu Goldin said:
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 said:
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 said:
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]


Thanks a lot
I need to call a VB function. It's possible?
-

message 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]


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

message How do you open it and do you pass the values to it?

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


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.
 
Back
Top