Access Session value in JavaScript function in ASP.Net

Last Reply 9 months ago By onais

Posted 9 months ago

i am getting the value in Master Page

string ab = (string)Session["UserID"]; 

i want pass the "ab" variable  value to javascript function and

if (ab > 0)

{ No change




disable <li class >



You are viewing reply posted by: onais 9 months ago.
Posted 9 months ago


protected void Page_Load(object sender, EventArgs e)
    string ab = (string)Session["UserID"]; // Read session
    Session["myValue"] = ab;


<script type="text/javascript">
    var yourSessionValue = '<%= Session["myValue"] %>';