login code Redirect do not work
<p>I made a web application and I want to Login in admincp for adminstrator and modcp for modrator manager.
this is code for login page :</p>

<pre><code>protected void btnOk_Click(object sender, EventArgs e)
{
    try
    {
        string user_n = txtUser.Text;
        string pass_n = txtPass.Text;
        Int32 res = 0;


        DAL.DAL log = new DAL.DAL();
        res = log.login_user_form(user_n, pass_n);




        if (res == 1)
        { 

           if (user_n == "admin")
              {
                  Response.Redirect("manage/AdminPage.aspx");
              }
       else 
         {
            Response.Redirect("modcp/defult3.aspx");
        }


        }
        else
        {
            lblRes.Text = "error username or password";
        }
    }
    catch (Exception ex)
    {
        lblRes.Text = ex.ToString();
    }


}
</code></pre>

<p>and in DAL layer this code :</p>

<pre><code>public Int32 login_user_form(String username, String password)
{
    int res = 0;
    con = new SqlConnection(strcon);
    SqlCommand cmd = new SqlCommand("EXEC chek_user '" + username + "' , '" + password + "'", con);

    try
    {
        con.Open();
        if (cmd.ExecuteScalar() == null)
        {
            res = 0;
        }

        else
        {
            res = 1;
        }

        con.Close();

    }
    catch (SqlException)
    {
        throw;
    }

    return res;
}
</code></pre>

<p>and this is my stored procedures : </p>

<pre><code>@username nvarchar(50) , @password nvarchar(50)
AS
BEGIN

SET NOCOUNT ON;
    SELECT username_l1 , password_l1 
    FROM user_L1
    WHERE username_l1 = @username AND password_l1 = @password
END
</code></pre>

<p>this cod in page  login.aspx in work without this line: </p>

<pre><code>Response.Redirect("manage/AdminPage.aspx");
</code></pre>

<p>if I clear this code and write : </p>

<pre><code>txtPass.Visible = false;
lblRes.Text = "mesesege";
</code></pre>

<p>That is work corect but without Response.Redirect, it doesn't?</p>

<p>(I dont know how work whit session for level access)</p>
