Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
hi,
 
i need simple login page for asp.net using c# with ADO.net
Posted 23-Apr-12 4:51am
Comments
Sastry_kunapuli at 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
good
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.
  Permalink  
Rate this: bad
good
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[^].
  Permalink  
Rate this: bad
good
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;
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Redirect("User.aspx");
}
}
  Permalink  
Comments
AlluvialDeposit at 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)



Advertise | Privacy | Mobile
Web02 | 2.8.141022.1 | Last Updated 24 Jul 2012
Copyright © CodeProject, 1999-2014
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