熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

ASP.NET項目開發指南:登錄系統(1)

2022-06-13   來源: .NET編程 

    登錄系統(

  登錄系統的入口使用一個用戶控件來實現其頁面如圖所示

  登錄頁面

  用戶登錄頁面ST_LogonModuleascx的HTML主要代碼

  頁面的主結構是個表可在其中輸入普通文本此外還包括一些Web控件以及一些用於驗證Web控件的控件如程序所示

  程序  ST_LogonModuleascx

    <TABLE cellSpacing= cellPadding= width=%>

        <TR class=rheader>

        <TD class=rheadercol align=left height=>員工登錄

        </TD>

        </TR> <! SPACER ROW >

        <TR class=rbody>

            <TD class=rbodycol align=left height=>

                <P>用戶請在此輸入正確的用戶名和密碼單擊登錄按鈕以登錄系統

                </P>

            </TD>

        </TR>

        <TR class=rbody>

            <TD class=rbodycol align=center height=>

                <TABLE width=%>

                    <TR>

                    <TD width=%>用戶名

                    </TD>

                    <TD width=%>

                        <asp:textbox id=LogonNameTextBox MaxLength=

                            runat=server></asp:textbox>

                        <!驗證用戶是否填寫了用戶名 >

                        <asp:requiredfieldvalidator

                id=LogonNameRequiredFieldValidator runat=server

                controlToValidate=LogonNameTextBox display=Dynamic

             errormessage=用戶名必須填寫>*</asp:requiredfieldvalidator>

                    </TD>

                    <TD>&nbsp;

                    </TD>

                    </TR>

                    <TR>

                        <TD width=%>密碼

                        </TD>

                        <TD width=%>

                            <asp:textbox id=LogonPasswordTextBox

    MaxLength= runat=server textmode=Password></asp:textbox>

                            <!驗證用戶是否填寫了密碼 >

                            <asp:requiredfieldvalidator

    id=LogonPasswordRequiredFieldValidator runat=server

    controlToValidate=LogonPasswordTextBox errormessage=密碼必須填寫

        display=dynamic>*</asp:requiredfieldvalidator>

                        </TD>

                        <TD>&nbsp;

                        </TD>

                    </TR>

                </TABLE>

            </TD>

        </TR>

        <TR>

            <TD align=left>

                <P>

                <asp:validationsummary id=LogonValidationSummary

                    runat=server HeaderText=請正確填寫您的用戶名及密碼>

                </asp:validationsummary>

                <asp:label id=MismatchLabel runat=server

                forecolor=RED Visible=False>用戶名或密碼錯誤請重新輸入

                <BR></asp:label>

                </P>

            </TD>

        </TR>

        <TR>

            <TD>

                <TABLE width=%>

                    <TR>

                        <TD width=%>&nbsp;

                        </TD>

                        <TD width=%><asp:button id=LoginButton

        runat=server BorderStyle=Groove text=登錄></asp:button></TD>

                    </TR>

                    <tr>

                        <td colspan=><asp:label id=ShowMsg

        runat=server></asp:label></td>

                    </tr>

                </TABLE>

            </TD>

        </TR>

    </TABLE>

       返回目錄ASPNET項目開發指南

       編輯推薦

       ASPNET MVC 框架揭秘

       ASPNET開發寶典

       ASP NET開發培訓視頻教程


From:http://tw.wingwit.com/Article/program/net/201311/15991.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.