F
FN
I'm using User.Identity.IsAuthenticated on all my pages (from a base class),
and redirecting to a login page if not authenticated. The problem is that
some pages are in subfolders and others are not. Such as:
www.domain.com/mustbeauth1.aspx > www.domain.com/login.aspx
www.domain.com/folder/mustbeauth2.aspx > www.domain.com/login.aspx
If I use Response.Redirect("login.aspx") the first one works, but the second
doesn't. I thought I could then use Response.Redirect ("/login.aspx") but
that causes an exception. And I don't want to hard-code the whole domain
in case this site is used on different domains. So, how can I reference
the virtual path of a file at the root level?
and redirecting to a login page if not authenticated. The problem is that
some pages are in subfolders and others are not. Such as:
www.domain.com/mustbeauth1.aspx > www.domain.com/login.aspx
www.domain.com/folder/mustbeauth2.aspx > www.domain.com/login.aspx
If I use Response.Redirect("login.aspx") the first one works, but the second
doesn't. I thought I could then use Response.Redirect ("/login.aspx") but
that causes an exception. And I don't want to hard-code the whole domain
in case this site is used on different domains. So, how can I reference
the virtual path of a file at the root level?