关于登陆的问题?
在ASP.NET中怎样在登陆成功后,重导向另一个页面private void Page_Load(object sender, System.EventArgs e)
{
string str="Persist Security Info=false;";
str+="user id=sa;password=sa;database=bbs;";
string sql="select * from users where username='"+username.Text+"'";
SqlConnection conn=new SqlConnection(str);
SqlCommand cmd=new SqlCommand(sql,conn);
DataSet ds=new DataSet();
SqlDataAdapter dr=new SqlDataAdapter(sql,conn);
dr.Fill(ds,"users");
if (username.Text.Trim()=="")
{
message.Text="请输入你的姓名";
}
else
{
if (ds.Tables["users"].Rows.Count==0)
{
Response.Redirect ("chklogin.aspx");
}
else
{
message.Text="正确";
}
}
}