Home > DeveloperSection > Forums > Session variable in Java script
Pooja Malohtra
Pooja Malohtra

Total Post:47

Points:331
Posted on    October-15-2010 7:54 AM

 JavaScript JavaScript 
Ratings:


 2 Reply(s)
 2369  View(s)
Rate this:

Please explain about how to read a session variable in JavaScript which is defined externally.

Can we read this within the page?


 



Uttam Misra

Total Post:124

Points:888
Posted on    October-15-2010 8:10 AM

use global variable in your ASPX file : var sessionValue = '<%= Session["YourKey"] %>'.

Now this global variable will be visible to the external JavaScript files that's included in the page.

You can use "sessionValue" as you need.


Pooja Malohtra
Pooja Malohtra

Total Post:47

Points:331
Posted on    October-15-2010 8:24 AM

thank you

Don't want to miss updates? Please click the below button!

Follow MindStick