本人是初学者,参考前人代码,一边学习,一边把内容分享给大家。。。。。。

页面效果如下:
 

login.aspx主要代码如下:
<body>
    <form id="form1" runat="server">
    <div>
        <table border="1" cellpadding="0" cellspacing="0">
            <caption>
                登录页面
            </caption>
            <tr>
                <td>
                    用户名:
                </td>
                <td>
                    <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    密&nbsp;&nbsp;&nbsp;码:
                </td>
                <td>
                    <asp:TextBox ID="txtUserPwd" runat="server" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <asp:Button ID="btnSummit" runat="server" Text="登录" OnClick="btnSummit_Click" />
                    <asp:Button ID="btnReset" runat="server" Text="取消" />
                </td>
            </tr>
        </table>
        <asp:Label ID="lblUserInfo" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>

login.aspx.cs主要代码如下:
    protected void btnSummit_Click(object sender, EventArgs e)
    {
        this.lblUserInfo.Text = "你的用户名为" + this.txtUserName.Text + "你的密码为" + this.txtUserPwd.Text;
    }