登录控件Login的应用

页面aspx代码

<asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate">

</asp:Login>

页面cs代码

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)

    {

        string strName = Login1.UserName;

        string strPwd = Login1.Password;

        if (strName == strPwd)

        {

            e.Authenticated = true;

            Response.Redirect("Admin_First.aspx");

        }

        else

        {

            e.Authenticated = false;

        }

    }

原文地址:https://www.cnblogs.com/wenming205/p/1272807.html