I want to know that how to use session in asp.net for that I use the following code:
protected void Page_Load(object sender, EventArgs e)
{
string academics = "academics";
Session["header_value"] = academics;
}
then I want to use that value in following code
<a href="academics.aspx">
<%if("header_value"=="academics")
{%>
<div id="academics" class="pri-nav active"></div>
<%}else{%>
<div id="academics" class="pri-nav"></div>
<%}%></a>
I also want to know that is there any other way to pass value to .cs other than session?
Protected or public variables can be accessed on the page.
and