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 } else { disable <li class > }
C#
protected void Page_Load(object sender, EventArgs e) { string ab = (string)Session["UserID"]; // Read session Session["myValue"] = ab; }
script
<script type="text/javascript"> var yourSessionValue = '<%= Session["myValue"] %>'; alert(yourSessionValue); </script>
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.