Пример #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            var context = new BlogumDBEntities();

            foreach (var user in context.Admin)
            {
                if (user.UserName == txtUserName.Text && user.Password == txtPassword.Text)
                {
                    Session["adminSession"] = txtUserName.Text;
                    Session.Timeout         = 30;
                    Response.Redirect("~/AdminPanel/Article/ArticleList.aspx");
                }
                else
                {
                    txtUserName.Text = "";
                    txtPassword.Text = "";
                }
            }
        }