Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to create simple login page in asp.net?


i want to create login page in asp.net...anybody now's?

with out using login controls..i wana code..pls explain that...
Posted
Updated 5-Aug-11 2:28am
v2

C#
SqlConnection cn = new SqlConnection();
cn.ConnectionString=System.Web.Configuration.WebConfigurationManager.ConnectionStrings["cnn"].ToString();
cn.Open();

        string cmd = "select id,Password from LogIn where id=@LoginID and Password=@Password";
SqlCommand cmd = new SqlCommand(cmd,cn);
        cmd.Parameters.AddWithValue("@LoginID", TextBox1.Text);
        cmd.Parameters.AddWithValue("@Password", TextBox2.Text);
       SqlDataReader dr = cmd.ExecuteReader();
        if (dr.Read())
        {
     Response.Redirect("groupdeatils.aspx");
            
         }
else
{
    Response.Write("Invalid attempt to login");
}
 
Share this answer
 
Comments
[no name] 5-Aug-11 8:32am    
hey thaq its working...i need videos about .net can u suggest any website?
Some one asked the similar question just now

how to create simple login page in asp.net?[^]
 
Share this answer
 
Comments
fjdiewornncalwe 5-Aug-11 8:27am    
Same person... :)
thatraja 5-Aug-11 8:33am    
*sigh*
*Going to take a cup of coffee*
fjdiewornncalwe 5-Aug-11 8:37am    
Why coffee, I think this calls for a pub run.
thatraja 5-Aug-11 8:45am    
But I don't drink, dance, etc., ..... Yes, not like Abhinav.
Please keep it as a secret :)

BTW A plan to go to this movie
fjdiewornncalwe 5-Aug-11 9:25am    
We all have our vices... :) I saw a tv advert for that movie last night while watching tv with the kids. I'm falling over because I did not know they were making a new one. I MUST SEE IT!!! Unfortunately, the wife and kids aren't interested... :(

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900