title: OnClick Event To Close Session in ASP.NET
body: <p>OnClick Is Not Working When I Clicked On Button</p>
  <p>I have Provided Button Named Logout and Written an Function That needs to be performed when that button is clicked.</p>
  <p>But when i clicked on it it's not executing the function, i checked by placing breakpoint, but breakpoint is not activated when i clicked on Logout button.</p>
  <pre><code>&lt;button type=&quot;submit&quot; class=&quot;btn btn-warning&quot; style=&quot;margin-top:-280px; margin-left:1100px;&quot; onclick=&quot;Logout()&quot;&gt;Logout&lt;/button&gt;
  
  &lt;script&gt;
      function Logout() {
          @Session[&quot;IsLoggedIn&quot;] = false;
          @Session[&quot;RoleId&quot;] = null;
          @Session[&quot;LoyalityPoints&quot;] = null;
          return RedirectToAction(&quot;IndexSeachBeforeLogin&quot;);
      }
  &lt;/script&gt;
  </code></pre>