protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e) { string usernname = this.Login1.UserName; string password = this.Login1.Password; //Query database and check if username and password exists //if they don't exits set e.Cancel = true; }