forum

Home / DeveloperSection / Forums / Show an error on a label box for invalid username or password

Show an error on a label box for invalid username or password

Royce Roy 2202 16-Dec-2013

Hi Guys

This is my code. How to write the code label box. I am selecting data from two different table for each table it ll redirect to two different pages. protected void Button1_Click(object sender, EventArgs e) { var qry = (from test in je.employee where test.emp_email.Equals(TxtUserName.Text) & test.emp_pass.Equals(TxtPassword.Text) select test).FirstOrDefault();

        if (null !=qry)
        {
            Response.Redirect("EmployeeHome.aspx");
        }          
        else
        {
            var qry2 =(from test1 in je.employer
                        where test1.c_mail.Equals(TxtUserName.Text) &
                              test1.c_pass.Equals(TxtPassword.Text)
                        select test1).FirstOrDefault();
            if (null!= qry2)
            {
                Response.Redirect("EmployerHome.aspx");
            }
         }
}

Updated on 16-Dec-2013

Can you answer this question?


Answer

1 Answers

Liked By