tags:

views:

45

answers:

2
 protected void btnsubmit_Click(object sender, EventArgs e)
    {
        try
        {

            String qry = "select id from login Where (useremail='" + txtuser.Text + "' AND password='" + txtpasswd.Text + "') ";
            SqlCommand cmd = new SqlCommand(qry, connect.getConnection());
            cmd.Connection.Open();
            SqlDataReader rd;
            rd = cmd.ExecuteReader();

            if (rd.Read())
            {
                Session["cid"] = rd[0].ToString();

                cmd.Connection.Close();
                Response.Redirect("Home.aspx");
            }
            else
            {
                Label5.Text = "Email Id And Password Dose Not Match...";
                Label5.Visible = true;
                txtuser.Focus();
                cmd.Connection.Close();
            }
        }
        catch (Exception ex)
        {


//for Error reading only on page default.aspx 
         Session["err"] = ex.ToString();
          Response.Redirect("default.aspx");

        }

        //finally
        // {
        //   cmd.Connection.Close();
        //}
    }

Please Help me as early as possible

+2  A: 

The ThreadAbort will be caused by the Response.Redirect. Just ignore it - it is harmless, and is even mentioned in the documentation.

kime waza
i didn't understood the initial question but i like your answer :)
Andrey
+2  A: 

Call this:

Response.Redirect("default.aspx", false);
Nick Craver