469,948 Members | 2,889 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

How to access session variable in html page

Hi All,

I need your help, i have 3 html pages and one aspx page.After
visiting the aspx page it creates one session variable this variable i
want to access in all my html pages thru anyway.
How can i access, give some idea is it possible or not.

Regards,
Madhuri.
Aug 21 '07 #1
3 12871
Plater
7,872 Expert 4TB
If you want to use a value in a plain html file, you will have to save it as a cookie, and then read it in with javascript.
Aug 21 '07 #2
Vijey
3
Hi All,

I need your help, i have 3 html pages and one aspx page.After
visiting the aspx page it creates one session variable this variable i
want to access in all my html pages thru anyway.
How can i access, give some idea is it possible or not.

Regards,
Madhuri.
To access the Session variable in Html Page use this syntax
<%Session["username"]%> where ever you want.

Another way is..
Consider your Session variable is like this..
Eg: Session["UserName"]

assign this value to another variable that must be "public".

public string UserName = Session["UserName"].ToString();

now in Html page call this value..

<%=UserName%>
Aug 27 '07 #3
Plater
7,872 Expert 4TB
That is an asp (aspx) page, not a plain html page.
To access the Session variable in Html Page use this syntax
<%Session["username"]%> where ever you want.

Another way is..
Consider your Session variable is like this..
Eg: Session["UserName"]

assign this value to another variable that must be "public".

public string UserName = Session["UserName"].ToString();

now in Html page call this value..

<%=UserName%>
Aug 27 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by farooqazeem | last post: by
2 posts views Thread by John Holmes | last post: by
1 post views Thread by Werner | last post: by
13 posts views Thread by Alexander Widera | last post: by
4 posts views Thread by T Ralya | last post: by
7 posts views Thread by tshad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.