asp.net one of a kind Secured Page problem
<p>If I use the following setting, I am unable to use Server.Transfer()/Response.Redirect() to redirect to a secured page:</p>

<pre><code>&lt;authentication mode="Forms"&gt;
        &lt;forms
          name="CookieDemo"
          loginUrl="Default.aspx"
          protection="All"
          timeout="30"
          path="/"
        /&gt;
      &lt;/authentication&gt;
      &lt;authorization&gt;
        &lt;deny
          users="?"
        /&gt;
</code></pre>

<p>I need to protect all pages except Default.aspx.</p>

<p>What should I do to solve this problem?</p>

<p>Note that, I am not using asp.net's built-in membership provider.</p>

<p>Here is my redirecting code:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
        {
            AspNetUtil util = new AspNetUtil(this);

            //util.DisposeCookie("user");

            UserTypeEnum userType = EnumUtility.ConvertToEnum(util.GetCookieValue("user", "usertype"));
            string username = util.GetCookieValue("user", "username");

            if (userType == UserTypeEnum.Student)
            {
                //Server.Transfer("~/Student/StudentControlPanel.aspx?username=" + username);
                Response.Redirect("~/Student/StudentControlPanel.aspx?username=" + username);
            }
            else if (userType == UserTypeEnum.Teacher)
            {
                //Server.Transfer("~/Teacher/TeacherControlPanel.aspx?username=" + username);
                Response.Redirect("~/Teacher/TeacherControlPanel.aspx?username=" + username);
            }
        }

protected void btnLogin_Click(object sender, EventArgs e)
        {
            string username = this.usernameTextBox.Text;
            string password = this.passwordTextBox.Text;

            bool success = Ice_Web_Portal.BO.User.LogIn(username, password);

            if (success)
            {
                Ice_Web_Portal.BO.User user = Ice_Web_Portal.BO.User.GetUserByUserName(username);

                Ice_Web_Portal.BO.UserTypeEnum loginUserType = user.UserTypeEnum;

                if (loginUserType == UserTypeEnum.Student)
                {
                    AspNetUtil util = new AspNetUtil(this);
                    util.SaveInCookie("user", "username", username, 3600);
                    util.SaveInCookie("user", "usertype", "Student", 3600);

                    //Server.Transfer("~/Student/StudentControlPanel.aspx?username=" + username);
                    Response.Redirect("~/Student/StudentControlPanel.aspx?username=" + username);
                }
                else if (loginUserType == UserTypeEnum.Teacher)
                {
                    AspNetUtil util = new AspNetUtil(this);
                    util.SaveInCookie("user", "username", username, 3600);
                    util.SaveInCookie("user", "usertype", "Teacher", 3600);

                    //Server.Transfer("~/Teacher/TeacherControlPanel.aspx?username=" + username);                
                    Response.Redirect("~/Teacher/TeacherControlPanel.aspx?username=" + username);
                }
                else
                {
                    labLoginMessage.Text = "Sorry! Type of user couldn't be determined!";
                }
            }
            else
            {
                labLoginMessage.Text = Ice_Web_Portal.BO.User.LoginMessage;
            }
        }
</code></pre>

<p>This is not working either:</p>

<pre><code>&lt;location path="Default.aspx"&gt;
    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;allow users="*"&gt;&lt;/allow&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;
  &lt;/location&gt;
</code></pre>
