|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieve a value from a PopUpHello 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. How do you open it and do you pass the values to it?
-- Show quoteEliyahu 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. > 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. >> > > Hi,
Patricio wrote: Show quote > Hi One possibility is to use the JavaScript "opener" property in the Window > > 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) 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 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. -- Show quoteEliyahu 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. >>> >> >> > > 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. >>>> >>> >>> >> >> > > 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. -- Show quoteEliyahu 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. >>>>> >>>> >>>> >>> >>> >> >> > > 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. >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > 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. -- Show quoteEliyahu 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. >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > 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. >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > Patricio wrote:
> Hello all by using QueryString you pass a value from popup to aspx page> 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,
tweety wrote: > Patricio wrote: That will force a postback on the main page.> >> 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 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 |
|||||||||||||||||||||||