How to pass data between two window without Session??

T

Terry

hi, could any1 help me with this?
[It's a ".aspx" page.]


There're one button and one textbox on Page A.
click the button:

<Code Behind >
Dim ClientScript As String = ""

ClientScript += " <SCRIPT language='javascript'> " & vbCrLf

ClientScript += "var features =" & ...........<--setup
height,width...etc

ClientScript += "window.open(B.aspx,'',features);" & vbCrLf

ClientScript += " </SCRIPT> "

If Not Me.IsClientScriptBlockRegistered("VBScript") Then

Me.RegisterClientScriptBlock("VBScript", ClientScript)

End If

End Sub



The above JavaScript will open B.aspx in a new window; There're
several controls and a "Submit" button on Page B. Users could click
"Submit" button and pass all information generate on Page B to Page A.
Click the "Submit" button:

Dim clientJavaScript As String

clientJavaScript += " <SCRIPT language='javascript'> " & vbCrLf

clientJavaScript &= " window.opener.Form1.textbox1.value = '" &
(whatever value) & "';" & vbCrLf

clientJavaScript &= " window.close(); " & vbCrLf

clientJavaScript &= "</script>"

Response.Write(clientJavaScript)



This will pass the value to textbox1 on Page A, and also close Page B
(itself).
I have to done this without any session or cookie, and the code shows
above just done what I want EXCEPT.....I need the textbox (which
receive the data) on Page A to be invisible. I tried to set the
textbox <visible=false>, then the server will not render that textbox.
So I tried a <input type=hidden ID=hiddentxt name=hiddentxt>, and this
won't work also. Anyone can help me?
 
K

kaeli

textbox <visible=false>, then the server will not render that textbox.
So I tried a <input type=hidden ID=hiddentxt name=hiddentxt>, and this
won't work also. Anyone can help me?

That hidden input should have worked. Did you make sure you called it
the right name, including character case? JS is case-sensitive. Maybe
you forgot to change the name when you changed it from a textbox to a
hidden input?


-------------------------------------------------
~kaeli~
Hey, if you got it flaunt it! If you don't, stare
at someone who does. Just don't lick the TV screen,
it leaves streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top