How to pass data between two window without Session??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry

    How to pass data between two window without Session??

    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='javas cript'> " & vbCrLf

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

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

    ClientScript += " </SCRIPT> "

    If Not Me.IsClientScri ptBlockRegister ed("VBScript") Then

    Me.RegisterClie ntScriptBlock(" 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 clientJavaScrip t As String

    clientJavaScrip t += " <SCRIPT language='javas cript'> " & vbCrLf

    clientJavaScrip t &= " window.opener.F orm1.textbox1.v alue = '" &
    (whatever value) & "';" & vbCrLf

    clientJavaScrip t &= " window.close(); " & vbCrLf

    clientJavaScrip t &= "</script>"

    Response.Write( clientJavaScrip t)



    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?
  • kaeli

    #2
    Re: How to pass data between two window without Session??

    In article <3a5f0251.03091 82015.344af6f0@ posting.google. com>,
    drexelterry@aol .com enlightened us with...[color=blue]
    > 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?
    >[/color]

    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.


    -------------------------------------------------

    Comment

    Working...