0

I'm using ASP.NET 2008 to create an web application with login page "Login.aspx". In that I've use control. Inside that I've created a table structure to place the controls and in that I've place username and password textboxes.

<asp:Login ID="LoginUser" LoginButtonStyle-CssClass="CommonButton" runat="server" 
    OnLoggedIn="LoginUser_LoggedIn" OnLoginError="LoginUser_Error" TitleText="" 
    Width="100%" DisplayRememberMe="true" OnLoggingIn="LoginUser_LoggingIn">
  <div style="margin-left: auto; margin-right: auto;">
     <table border="0" cellpadding="0" style="margin-left: auto; margin-right: auto;">
         <tr>
           <td style="padding-bottom: 8px;">
              <asp:TextBox ID="UserName" runat="server" autocomplete="off" CssClass="CommonTextBox" Width="325" TextMode="SingleLine"></asp:TextBox>
           </td>
         </tr>
         <tr>
           <td>
              <asp:TextBox ID="Password" runat="server" autocomplete="off"  CssClass="CommonTextBox" Width="325" TextMode="Password"></asp:TextBox>
           </td>
        </tr>
      </table>
    </div>
</asp:Login>

Now when I enter username and password, the browser prompts for save password. But I don't need that prompt.

I'm not using any HTML controls. Its all ASP.NET controls.

How to prevent browser from prompt..?

I've used everything that was already answered. But nothing worked for me. That's why Ive asked newly. I searched for many possible ways, and all failed. This is not a duplicate one.

Sakthi
  • 1
  • 2
  • That's a browser feature and has little to do with your code. – Knelis Jun 22 '15 at 10:56
  • Most browsers should have a "never save for this site" option. Just click it. – CodesInChaos Jun 22 '15 at 11:01
  • What little to do with my code? I'm ready to do whatever. I just want to prevent the prompt. I've user `AutocompleteType="Disabled"` also.. – Sakthi Jun 22 '15 at 11:01
  • If your site is anything typical, if you do this, your users will hate you and figure out from their end how to bypass your attempts to stop them from doing what they want to do. Perhaps your site (or your user base) isn't typical, and in that case go ahead, but I strongly recommend you do check this with your users. –  Jun 22 '15 at 11:17
  • @hvd, this is what my user wants. I'm not implementing unwanted. – Sakthi Jun 22 '15 at 11:24
  • This is client side feature, it is not under your control. – Franck Jun 22 '15 at 11:28
  • @Sakthi Glad to hear that. Then I'm glad I put the "your site (or your user base) isn't typical" exception in my comment. :) –  Jun 22 '15 at 11:41

1 Answers1

1

In your form in the HTML set the attribute autocomplete="off"

<form autocomplete="off" id="form1">
Daniel James Bryars
  • 4,429
  • 3
  • 39
  • 57