Source view of LOGIN.ASPX
DotNet Funda: Code Viewer
login.aspx | login.aspx.cs
Close Window  
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHeader" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderForTitleAndIntro" Runat="Server">
    <table width="100%" cellpadding="2" cellspacing="0">
        <tr valign="top" class="ArticleTitle">
            <td style="padding-left:10px;" valign="middle">
                asp:Login control</td>
        </tr>
        <tr>
            <td class="ArticleContents">
                Login control provides a ready to use user interface that can be used as a Login interface in the web site.
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderForContents" Runat="Server">
    <div class="ArticleContents">
        Login control provides a ready to use user interface that can be used as a Login interface in the web site.
        Internally, When it is rendered on the page, it is implemented through &lt;table&gt;&lt;/table&gt; HTML tag.
        <p>
            Its properties like <span class="DemoCP">BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. </span>
            are implemented through style properites of &lt;table, tr, td/&gt; tag. 
        </p>
                
        Following are some important properties that are very useful.
        <table width="100%" class="TutoPropPlaceHolder" border="1" cellpadding="2" cellspacing="1">
            <tr>
                <th colspan="2" align="left">Properties of the Login Control</th>
            </tr>
            <tr>
                <td class="DemoCP">TitleText</td>
                <td>
                    Indicates the text to be displayed in the heading of the control.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">InstructionText</td>
                <td>
                    Indicates the text that appears below the heading of the control.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">UserNameLabelText</td>
                <td>
                    Indicates the label text of the username text box.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">PasswordLabelText</td>
                <td>
                    Indicates the label text of the password text box.
                </td>
            </tr>
            <tr valign="top">
                <td class="DemoCP">FailureText</td>
                <td>
                    Indicates the text that is displayed after failure of login attempt.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">UserName</td>
                <td>
                    Indicates the initial value in the username text box.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">LoginButtonText</td>
                <td>
                    Indicates the text of the Login button.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">LoginButtonType</td>
                <td>
                    Button/Link/Image. Indicates the type of login button.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">DestinationPageUrl</td>
                <td>
                    Indicates the URL to be sent after login attempt successful.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">DisplayRememberMe</td>
                <td>
                    true/false. Indicates whether to show Remember Me checkbox or not.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">VisibleWhenLoggedIn</td>
                <td>
                    true/false. If false, the control is not displayed on the page when the user is logged in.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">CreateUserUrl</td>
                <td>
                    Indicates the url of the create user page.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">CreateUserText</td>
                <td>
                    Indicates the text of the create user link.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">PasswordRecoveryUrl</td>
                <td>
                    Indicates the url of the password recovery page.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">PasswordRecoveryText</td>
                <td>
                    Indicates the text of the password recovery link.
                </td>
            </tr>
            
            <tr>
                <th colspan="2" align="left">Style of the Login Control</th>
            </tr>
            <tr>
                <td class="DemoCP">CheckBoxStyle</td>
                <td>
                    Indicates the style property of the Remember Me checkbox.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">FailureStyle</td>
                <td>
                    Indicates the style property of the failure text.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">TitleTextStyle</td>
                <td>
                    Indicates the style property of the title text.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">LoginButtonStyle</td>
                <td>
                    Indicates the style property of the Login button.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">TextBoxStyle</td>
                <td>
                    Indicates the style property of the TextBox.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">LabelStyle</td>
                <td>
                    Indicates the style property of the labels of text box.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">HyperLinkStyle</td>
                <td>
                    Indicates the style property of the hyperlink in the control.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">InstructionTextStyle</td>
                <td>
                    Indicates the style property of the Instruction text that appears below the heading of the control.
                </td>
            </tr>
            
            <tr>
                <th colspan="2" align="left">Events of the Login Control</th>
            </tr>
            <tr>
                <td class="DemoCP">LoggingIn</td>
                <td>
                    Fires before user is going to authenticate.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">LoggedIn</td>
                <td>
                    Fires after user is authenticated.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">LoginError</td>
                <td>
                    Fires after failure of login attempt.
                </td>
            </tr>
            <tr>
                <td class="DemoCP">Authenticate</td>
                <td>
                    Fires to authenticate the user. This is the function where you need to write your own code to validate the user.
                </td>
            </tr>
        </table>
        <!-- START - Demo Section -->
        <table class="DemoPlaceHolder" border="1" cellpadding="2" cellspacing="4">
            <tr>
                <td class="DemoTitle">
                    DEMO : Login
                </td>
                <td align="right">
                    <a class="DemoShowSource" href="../../misc/codeviewer/default.aspx?pagename=~/tutorials/controls/login.aspx" target="_blank">Show Source Code</a>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4"
                        BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em"
                        ForeColor="#333333" OnAuthenticate="Login1_Authenticate" OnLoginError="Login1_LoginError"
                         PasswordRecoveryUrl="receoverypassword.aspx" PasswordRecoveryText="Forget password?"
                          CreateUserUrl="createuser.aspx" CreateUserText="Register User">
                        <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
                        <InstructionTextStyle Font-Italic="True" ForeColor="Black" />
                        <TextBoxStyle Font-Size="0.8em" />
                        <LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"
                            Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" />
                    </asp:Login>
                </td>
                <td>
                    For working example, Please <a target="_blank" href="<%= Resources.SiteConfiguration.DemoProjectUrl %>">visit</a> or <a target="_blank" href="<%= Resources.SiteConfiguration.DemoProjectDownloadUrl %>">Download</a>.
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <!-- START - Server Side Code -->
                    <pre>                    
// Login Control ////////////////////////////          
&lt;asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4"
    BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em"
    ForeColor="#333333" OnAuthenticate="Login1_Authenticate" OnLoginError="Login1_LoginError"&gt;
    &lt;TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" /&gt;
    &lt;InstructionTextStyle Font-Italic="True" ForeColor="Black" /&gt;
    &lt;TextBoxStyle Font-Size="0.8em" /&gt;
    &lt;LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"
        Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" /&gt;
&lt;/asp:Login&gt;


                    </pre> 
                    <!-- END - Server Side Code -->
                </td>
            </tr>
        </table>
        <!-- END - Demo Section -->
        </div>
    <br />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderFooter" Runat="Server">
</asp:Content>

Go Top