470,624 Members | 2,459 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,624 developers. It's quick & easy.

store javascript value from window.open in session variable

hi al

i have "variab1 = window.open ("a.aspx", "helloworld");

i do this inside a RegisterStartupScrict ("key", "<script language=javascript>******</script>"); where ***** is hte javascript comman

i need to access variab1 from some other forms (to close it from another link from the parent's parent's parent's page). i figured out that the best way to do this is to store this javascript variable in a session variable

now comes the golden question. "How can I save a javascript variable in a session variable?

thanks
Nov 18 '05 #1
3 7166
Hi,
i have "variab1 = window.open ("a.aspx", "helloworld");"
i do this inside a RegisterStartupScrict ("key",
"<script language=javascript>******</script>");
where ***** is hte javascript command

i need to access variab1 from some other forms (to close it from another
link from the parent's parent's parent's page). i figured out that the best way to do this is to store this javascript variable in a session variable.

now comes the golden question. "How can I save a javascript variable in
a session variable?"


It seems that you mix server- and client-side code in your discourse.
A javasript code will be executed on client-side, whereas the session
variable accessible mainly on server-side.

--
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
http://www.nesterovsky-bros.com

Nov 18 '05 #2
use a hidden frame to post the value back., though keeping the handle valid
will be difficult if any of the pages in the chain postback.

a better approach is to have each child window register itself with its
parent, who regiters the window with its parent, etc.

-- bruce (sqlwork.com)


"Michelle Stone" <mi********@yahoo.com> wrote in message
news:48**********************************@microsof t.com...
hi all

i have "variab1 = window.open ("a.aspx", "helloworld");"

i do this inside a RegisterStartupScrict ("key", "<script language=javascript>******</script>"); where ***** is hte javascript command
i need to access variab1 from some other forms (to close it from another link from the parent's parent's parent's page). i figured out that the best
way to do this is to store this javascript variable in a session variable.
now comes the golden question. "How can I save a javascript variable in a session variable?"
thanks

Nov 18 '05 #3
Thanks for the response..

I just need to close all child windows (and all grandchildren windows if i may put it that way) when i click on a button the FIRST window that is the head of all the child windows. What I had thought of was putting all the handles of all the child windows in an array stored in a session variable, and then later writing a loop that will close the windows represented by the elements of the array

I understand from your message that handles themselves are valid only till a postback, and in my application, every page goes through lots of postback before hte parent will close them, which implies that my method will not work

I will appreciate it if anyone can suggest some way I can implement what I want

You said something about registering a child with its parent by itself. What did you mean? Please elaborate. Thanks..

----- bruce barker wrote: ----

use a hidden frame to post the value back., though keeping the handle vali
will be difficult if any of the pages in the chain postback

a better approach is to have each child window register itself with it
parent, who regiters the window with its parent, etc

-- bruce (sqlwork.com


"Michelle Stone" <mi********@yahoo.com> wrote in messag
news:48**********************************@microsof t.com..
hi al
i have "variab1 = window.open ("a.aspx", "helloworld");
i do this inside a RegisterStartupScrict ("key", "<scrip language=javascript>******</script>"); where ***** is hte javascript comman i need to access variab1 from some other forms (to close it from anothe link from the parents parents parents page). i figured out that the bes
way to do this is to store this javascript variable in a session variable now comes the golden question. "How can I save a javascript variable in session variable? thank


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.