title: How to set value of Session to LoginName without Membership in Asp.Net
body: <p>I have <code>MasterRoot.Master</code> and <code>LoginPage.aspx</code></p>
  
  <p>How can I set value of <code>Session</code> to <code>HeadLoginName</code> after user success Login.</p>
  
  <p><strong>Login.aspx.cs</strong></p>
  
  <pre><code>protected void btnLogin_Click(object sender, EventArgs e) {
  
      UserClass user=new UserClass();
      user.LoginProcess(txtUserName.Text,txtPass.Text);
  
      if(user.loginsuccess) {
  
          Session["UserName"]=user.username.ToString();
      }
  }
  </code></pre>
  
  <p><strong>MasterRoot.Master.cs</strong></p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e) {
  
      // Like this HeadLoginName.Text=Session["UserName"].ToString();
  } 
  </code></pre>