Create a login system using config file using .net web aplication
LoginPage.aspx page
This below page used for the Textbox and password field
Login Here
|
|
|
web config file
file name: LoginPage.aspx.cs
The below using System.Web.Security;
is important to execute the below code
using System.Web.Security;
protected void Button1_Click(object sender, EventArgs e) { if(FormsAuthentication.Authenticate(TextBox1.Text, TextBox2.Text)) { FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false); } else { Label3.Text = "Invalid Credentials entered."; } //if (TextBox1.Text == "admin" && TextBox2.Text == "password") //{ // Response.Redirect("TravelDetailsInsert.aspx"); // Label3.Text = Convert.ToString("Successfully Login"); //} //else //{ // Response.Write(""); // Label3.Text = Convert.ToString("UnSuccessfully Login"); //} }