⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 signin.aspx.cs

📁 ASP.net网站开发四“酷”全书:新闻、论坛、电子商城、博客_源码
💻 CS
字号:
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BookShop.Web {
	public class SignIn : Page {

		protected TextBox txtUserId;
		protected TextBox txtPassword;
		protected BookShop.Web.Controls.NavBar header;
		protected System.Web.UI.WebControls.RequiredFieldValidator valPassword;
		protected System.Web.UI.WebControls.ImageButton btnSubmit;
		protected System.Web.UI.HtmlControls.HtmlForm frmSignIn;
		protected RequiredFieldValidator valUserId;

		private const string MSG_FAILURE = "Sign in failed! Please try again.";

		private void InitializeComponent() {
		}

		protected void SubmitClicked(object sender, ImageClickEventArgs e) {
			if (Page.IsValid) {
				
				// Get the user info from the text boxes
				string userId = WebComponents.CleanString.InputText(txtUserId.Text, 50);
				string password = WebComponents.CleanString.InputText(txtPassword.Text, 50);

				// Hand off to the account controller to control the naviagtion
				ProcessFlow.AccountController accountController = new ProcessFlow.AccountController();

				if (!accountController.ProcessLogin(userId, password)){

					// If we fail to login let the user know
					valUserId.ErrorMessage = MSG_FAILURE;
					valUserId.IsValid = false;
				}
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -