login page with aunthencation and without database
Login page
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
login page with aunthencation and without database
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vishal YelveRank #178 · 13.6K reputationPosted Jul 7, 2023, 6:07 AM EDT
Hi Pavan,
refer below links
https://meeraacademy.com/create-simple-login-page-in-asp-net/
https://www.neerajcodesolutions.com/2017/06/login-page-in-mvc-without-database.html
https://stackoverflow.com/questions/63856693/login-functionality-in-asp-net-core-without-database
Deepak RawatRank #646 · 3.7K reputationPosted Jul 5, 2023, 3:03 AM EDT
Create a new ASP.NET Web Forms application in Visual Studio.
Add a new Web Form called "Login.aspx" to your project.
Design the Login.aspx page with HTML and ASP.NET controls.
In the code-behind file "Login.aspx.cs", add the following code:
using System; namespace YourNamespace { public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnLogin_Click(object sender, EventArgs e) { string username = txtUsername.Value; string password = txtPassword.Value; // Check the entered credentials if (username == "admin" && password == "password") { // Successful login Response.Redirect("Welcome.aspx"); } else { // Invalid credentials lblErrorMessage.Text = "Invalid username or password."; } } } }Add another Web Form called "Welcome.aspx" to your project.
Design the Welcome.aspx page to display a welcome message or any other content.
Run the application and navigate to the Login.aspx page. You can use the username "admin" and password "password" for testing.