public partial class Admin_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection con = null;
ConectionStrings cs = new ConectionStrings();
SqlCommand comm = null;
SqlDataReader reader = null;
SqlDataAdapter da;
protected void btnadmin_login_Click(object sender, EventArgs e)
{
con = new SqlConnection(cs.Db);
con.Open();
//string logincheck = "select * from Admin_login where admin_name [email protected] and [email protected]";
string login = " Select * from Admin_login where admin_name = '" + txtadmin_name.Text + "' and admin_pwd = '" + txtadmin_pwd.Text + "' ";
comm=new SqlCommand(login,con);
// comm.Parameters.AddWithValue("@username", txtadmin_name.Text);
// // da = new SqlDataAdapter(login, con);
// comm.Parameters.AddWithValue("@admin_pwd", txtadmin_pwd.Text.Trim());
//
reader = comm.ExecuteReader();
if (reader.Read())
{
Response.Redirect("Admin Add_Books.aspx");
}
else
{
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Invalid Username and Password')</script>");
}
con.Close();
}
}
public partial class Admin_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection con = null;
ConectionStrings cs = new ConectionStrings();
SqlCommand comm = null;
SqlDataReader reader = null;
SqlDataAdapter da;
protected void btnadmin_login_Click(object sender, EventArgs e)
{
con = new SqlConnection(cs.Db);
con.Open();
//string logincheck = "select * from Admin_login where admin_name [email protected] and [email protected]";
string login = " Select * from Admin_login where admin_name = '" + txtadmin_name.Text + "' and admin_pwd = '" + txtadmin_pwd.Text + "' ";
comm=new SqlCommand(login,con);
// comm.Parameters.AddWithValue("@username", txtadmin_name.Text);
// // da = new SqlDataAdapter(login, con);
// comm.Parameters.AddWithValue("@admin_pwd", txtadmin_pwd.Text.Trim());
//
reader = comm.ExecuteReader();
if (reader.Read())
{
Response.Redirect("Admin Add_Books.aspx");
}
else
{
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Invalid Username and Password')</script>");
}
con.Close();
}
}
모든 것이 괜찮아하지만 로그 아웃 페이지
더 명확히하십시오. 문제가 무엇입니까? 무엇을 시도 했습니까? – JoJo
'url same copy my homepage same'을 설명 해주시겠습니까? (-1) - 명확하지 않다. –