tags:

views:

36

answers:

1

I have followed the asp.net pages for registration and login. Everything works, except that the username/password combo is never remember by the browser (ie. browser autocomplete). This is an issue with all browsers. The key fields seem to be named appropriately, I think:

    <LayoutTemplate>
            <div class="formlayout">
                <p>
                    Enter your login details</p>
                <asp:ValidationSummary runat="server" DisplayMode="BulletList" CssClass="errors" />
                <div class="b">
                    <asp:RegularExpressionValidator runat="server" Display="Dynamic" ErrorMessage="Invalid email address."
                        ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
                        ControlToValidate="UserName" SetFocusOnError="false" >*</asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator runat="server" Display="Dynamic" ErrorMessage="Enter your email address."
                        ControlToValidate="UserName" SetFocusOnError="false" >*</asp:RequiredFieldValidator>
                    Email address<div class="s">
                        Your login identity</div>
                </div>
                <div class="tb">
                    **<asp:TextBox runat="server" ID="UserName" />**</div>
                <div class="b">
                    <asp:RequiredFieldValidator runat="server" Display="Dynamic"
                        ErrorMessage="Enter your password." ControlToValidate="UserName" SetFocusOnError="false" >*</asp:RequiredFieldValidator>
                    Password<div class="s">
                        Your registered password</div>
                </div>
                <div class="tb">
                    **<asp:TextBox runat="server" ID="Password" Name="Password" ClientIDMode="Static" TextMode="Password" />**</div>
                <div class="shift">
                    <asp:CheckBox runat="server" ID="RememberMe" Text="Keep me logged in" />
                </div>
                <div class="shift">
                    <asp:Button ID="BtnLogin" ClientIDMode="Static" runat="server" CommandName="Login" Text="Login" />
                </div>
            </div>
        </LayoutTemplate>

To clarify: My browser is set to remember passwords. Here's a thought... I am testing off 'localhost' -- are browsers set not to remember usernames and passwords that are running off localhost?

A: 

Your server-side code does not have anything to do with whether or not the browser's Auto-Complete works. That's a setting in the browser.

David Stratton
Agreed. The thing is that my browsers all autocomplete passwords... Obviously something in the HTML needs to trigger the browser to store things, and is somewhat misplaced in my HTML.
Testing123
This is what you want! If you allow autocompletion of usernames/passwords in the browser, anyone could rock up to an unlocked PC and get access to your application.
PhilPursglove