Search code examples
vb.nettextboxvisual-web-developer-2010

TextBox showing past entries


I can not get the textbox past entries to go away using the aspx.vb behind page ( can do it on aspx page) Example below

Example

I have tried both

        txt.AutoCompleteType = AutoCompleteType.Disabled
        txt.ViewStateMode = UI.ViewStateMode.Disabled

Solution

  • add autocomplete="off" attribute to textbox

    <asp:TextBox Runat="server" ID="Textbox1" autocomplete="off"></asp:TextBox>
    

    or add to to from tag

    <form id="Form1" method="post" runat="server" autocomplete="off">
    

    using code behind

    Textbox1.Attributes.Add("autocomplete", "off");