title: How to disable autocomplete in asp:login control?
body: <p>Is there a way of using <code>autocomplete="off"</code> in <code>&lt;asp:Login&gt; &lt;/asp:login&gt;</code>. I tried to convert  asp:login to template and put the autocomplete="off" attribute in asp:TextBox element however this breaks other part of login process. Is there a way of disabling autocomplete without using javascript and without converting to template. if its possible behind code is fine. Look forward to your suggestions. Thanks</p>
  
  <p>Here is the code in Page_Load</p>
  
  <pre><code>  if (!Page.IsPostBack)
      {
          var control = this.FindControlRecursive(LoginArea, "UserName") as TextBox;
  
          if (control != null)
          {
              control.Attributes.Add("autocomplete", "off");
          }
  
          var control2 = this.FindControlRecursive(LoginArea, "Password") as TextBox;
  
          if (control2 != null)
          {
              control2.Attributes.Add("autocomplete", "off");
          }
      } 
  </code></pre>
  
  <p>And here aspx page: </p>
  
  <pre><code>&lt;asp:Login ID="LoginArea" runat="server" SkinID="Login" CssSelectorClass="PrettyLogin"
                     DestinationPageUrl="Home.aspx" LoginButtonImageUrl="" 
                     LoginButtonText="login button"
                     LoginButtonType="Button" 
                     UserNameLabelText="username&gt;" 
                     PasswordLabelText="password"
                     TitleText="title" 
                     RememberMeSet="false" DisplayRememberMe="false" 
                     FailureText="failed"
                     ToolTip="tool tip"
                     PasswordRecoveryText="" 
                     PasswordRecoveryUrl="urlforpasswordrecovery"
                     CreateUserText="" 
                     CreateUserUrl="" OnLoggedIn="LogOn_LoggedIn"
                     OnLoggingIn="LogOn_LoggingIn" OnLoginError="LogOn_Error" &gt;
          &lt;/asp:Login&gt;
  </code></pre>