I need to access a Session Variable in javascript. I tried all the examples but none of them are working. I do not know what I am doing wrong.
I have the following:
In my Account controller after successful login I set my Session Variable like this.
HttpContext.Session.Add("IsShowStartPopUp", true);
In my landing view I try to access the session variable like this:
<script type="text/javascript">
var IsShowStartPopUp = '<%= Session["IsShowStartPopUp"] %>';
</script>
My result is:
'<%= Session["IsShowStartPopUp"] %>'
Am I missing something?
Thanks you.