我想,如果他们没有登录的任何用户受到限制限制用户。 想,如果他们试图通过粘贴他们仍然被重定向到登录页面的链接访问任何页面。访问任何网页,而不登录
LoginPage
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("select * from Employee where UName [email protected] and [email protected]", con);
cmd.Parameters.AddWithValue("@username", UName.Text);
cmd.Parameters.AddWithValue("@password", UPassword.Text);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
Response.Redirect("Details.aspx");
}
}
我不想限制每个文件夹分开。 –
所以你可以使用第二个片段(所有页面都用'')。 –
feeeper
我如何知道用户已通过身份验证?没有会议 –