title: Add to OnFocus codebehind without deleting current OnFocus
body: <p>I'm developing an ASP.NET page with c# on the backend.</p>
  
  <p>I have some javascript to keep track of where the last focus was before postback, and setting it after postback. However, if the field getting focus is a password field, I need to clear the input when the control gets focus.</p>
  
  <p>I have added this like this:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (TextBox.Text.Trim().Length &gt; 0)
      {
      TextBox.Attributes.Add("onfocus", "this.value=''");
      }
  }
  </code></pre>
  
  <p>but now it overrides my JavaScript, so when I click the next textbox the focus is lost.</p>
  
  <p>Can I add the lines after each other in some way? Like this:</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBoxPassword" runat="server" TextMode="password" onfocus="try{document.getElementById(&amp;#39;__LASTFOCUS&amp;#39;).value=this.id} catch(e) {} + this.value=''" &gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>I know it cannot be done with a <code>+</code>, but is there some way to do this?</p>