Is there a way to dynamically change the LoginUrl of FormsAuthentication? What I have is the whole site protected by FormsAuth, but for some pages in a sub folder, I\'d lik
I had this problem as well and have just googled here trying to solve it then remembered had done it long ago and what I did was in the default login.aspx page in the root folder in the Page_Load event I did a redirect based on return url to my sub directory manage and its login.aspx page! You'd have to repeat the relevant bit for each sub directory.
public void Page_Load(object sender, EventArgs e)
{
//check for existence of ReturnUrl in QueryString
//if it contains manage redirect to manage login page
if (!String.IsNullOrEmpty(Request.QueryString["ReturnUrl"]))
{
if (Request.QueryString["ReturnUrl"].Contains("manage"))
{
Response.Redirect("manage/login.aspx");
}
}
}