Click here to Skip to main content
12,756,437 members (31,659 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET

i need simple login page for using c# with
Posted 23-Apr-12 5:51am
Sastry_kunapuli 23-Apr-12 10:52am
Use the default one that comes with the ASP.NET application.It works good for a simple login page
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Start here[^]. I mean, really, at least give it a go first before asking for an out-of-the-box solution.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Look here:
Traditional Login page design discussion[^]

Login Controls were released by Microsoft, have a look at them here[^].
For, building Login Page using Login control, look:
How to: Create an ASP.NET Login Page[^]
ASP.NET Login Controls Overview[^]
How to add a Login, Roles and Profile system to an ASP.NET 2.0 [^]

If needed, pick any example from here: Google Search result on the same[^].
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

protected void Login_Click(object sender, EventArgs e)
SqlConnection con = new SqlConnection("Data Source=SYSTEM1;Initial Catalog=master;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
string sql;
sql = "select *from user1 where uname ='" + TextBox1.Text + "' and pwd = '" + TextBox2.Text + "'";
cmd.CommandText = sql;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
AlluvialDeposit 24-Jul-12 5:55am
This is a solution is vulnerable to sql-injections! And it's a solution where you store passwords as clear text in your database.
If someone types "'; DELETE FROM user1 WHERE ''='" in TextBox2, then your table is wiped out.

Please read my article about storing passwords and sql-injections

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170217.1 | Last Updated 24 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100