store javascript value from window.open in session variable

G

Guest

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
 
A

Arthur Nesterovsky

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

bruce barker

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 said:
hi all

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

i do this inside a RegisterStartupScrict ("key", "<script
language=javascript>****** said:
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.
 
G

Guest

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

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top