Use Session variable in html
Use a code block:
Hello <%:Session["user"]%>
Or if before .NET 4.0:
Hello <%=Server.HtmlEncode(Session["user"])%>
I was actually trying a lot to get my session value from a page to another html in asp.net
.
However some syntactical error was always acting as an hindrance.
In order to solved it, I've created a web page and there I initiated the session in the code behind and directed that to the other page.
Note, this is a .html
page, so now in the body I used
Hello <%=Session["UserID"]%>
instead of
Hello <%:Session["user"]%>
(which wasn't working) and it fetched the value from my .cs
to my .html
file.