title: Is it possible to apply an onclick() event to a span tag?
body: <p>To make sure that an event handler is written properly, I generally have Visual Studio generate the event for me.  However, I can't find a way to do this with a div and I've tried typing it out myself to no avail.  Is this even possible without writing any javascript? (I saw similar questions, but couldn't seem to find anything that fit my needs).</p>
  
  <p>Edit:  Basically I have a logoff div disguised to the user as a button.  When they click it, I want the following to happen:</p>
  
  <pre><code> protected void LogOff_Click(object sender, EventArgs e)
      {
          FormsAuthentication.SignOut();
          Session.Abandon();
  
          //This will clear the authentication cookie
          HttpCookie myHttpCookie = new HttpCookie(FormsAuthentication.FormsCookieName, "");
          myHttpCookie.Expires = DateTime.Now.AddYears(-1);
          Response.Cookies.Add(myHttpCookie);
  
          //This will clear the session cookie (not required for my application but applying to be safe)
          HttpCookie myHttpCookie2 = new HttpCookie("ASP.NET_SessionId", "");
          myHttpCookie2.Expires = DateTime.Now.AddYears(-1);
          Response.Cookies.Add(myHttpCookie2);
  
          FormsAuthentication.RedirectToLoginPage();
      }
  </code></pre>
  
  <p>Here's where I call this event: </p>
  
  <pre><code> &lt;a href="Log_In.aspx"&gt;&lt;span class="MenuItem" runat="server" onclick="LogOff_Click"&gt;Log Off&lt;/span&gt;&lt;/a&gt;
  </code></pre>