protected void submit_Click(object sender, EventArgs e) { clsregister obj = new clsregister(); clsregistrationprp objprp = new clsregistrationprp(); objprp.rollno = username.Text; objprp.password = password.Text; Label1.Visible = true; try { Int32 b = obj.logincheckrollb(objprp); Int32 a = obj.logincheckrolla(objprp); if (b == -6) { Session["cod"] = a; Response.Redirect("next/student/detailsu.aspx"); } else if (b == -5) { Session["cod"] = a; Response.Redirect("next/parent/detailpa.aspx"); } else { Label1.Text = "error"; } } catch (Exception exp) { Label1.Text = "INVALID USERNAME PASSWORD"; } }