Re: Form Authentication

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michael Mayer [C# MVP] (mike_at_mag37.com)
Date: 02/16/04


Date: Mon, 16 Feb 2004 15:47:55 -0600

Try "~/CommonPages/loginPage.aspx"

Commands like Response.Redirect() and a lot of other server side controls
interpret "~/" as application root. Be careful that you dont do something
like this:

<A href="~/CommonPages/loginPage.aspx">Login</a>
because the users machine won't know ~/

Instead, i think this would work:
<A href='<%# ~/CommonPages/loginPage.aspx %>'>Login</a>

-- 
Mike Mayer, C# MVP
mike@mag37.com
http://www.mag37.com/csharp/
"slawek xxxxx" <slawek7302@wp.pl> wrote in message
news:Ol2BDHI9DHA.2432@TK2MSFTNGP10.phx.gbl...
> Hello everyone,
>
> I have found a problem with form authentication method that I can't
> solve. The problem is:
>
> I want to use a form authentication in my application, so i set :
> <authentication mode="Forms">
> ,and
> <forms name="LoginForm" loginUrl="SM_LoginPage.aspx" protection="All">
>
> but the structure of my application folders is following:
>
> root
> |
> +CommonPages
> |          + loginPage.aspx
> |
> +SysPages
> |      + Sys1Pages
> |      |          +Page1.aspx
> |      + Sys2Pages
> |                 +Page2.aspx
> + OtherPages
>            + Page3.asp
>
> Because of this structure the relative path of LoginPage.aspx is
> diffrent for Page1.aspx(../../CommonPages/loginPage.aspx) and Page for
> page3.aspx(../CommonPages/loginPage.aspx). I have to set this path in
> web.config and I want to use relative path (not http://.....). Is there
> any way to do this?? (sth like {root}//CommonPages/loginPage.aspx)??
> Thanks for any help
>
> Best Regards
> Slawek
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


Relevant Pages

  • Re: include, relative path
    ... I'm having a stupid problem with the include command. ... I need to connect to the database from the script "check.php", ... Here you tell to go to root, then get one step closer to root and then look for the libraries directory, we could translate this to "Libraries:\". ... One way to get around some troubles are to use symlinks, this way you can have virtual directories which are located in the same relative path from the calling file, but that could be a bit difficult before you have a grasp of how paths works. ...
    (alt.php)
  • Re: include, relative path
    ... success, maybe because of the PHP version... ... This is a subdirectory for the root of the file system, ... directories which are located in the same relative path from the calling ...
    (alt.php)
  • Re: Getting the application path
    ... Use a relative path beginning with a tilde and a slash: ... the application's root, no matter what the domain name is. ... > Today, it is on a test server, but when I move it to the production ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Its trying to compile my JavaScript?
    ... I'm running from the ASP.NET web server, so the root of the application ... when use just "/" it's mean relative path from the root.. ... JavaScript. ...
    (microsoft.public.dotnet.framework.aspnet)
  • How to disable Form authentication
    ... I use authorization to Form in the root Web.config ... But now I want to disable the Form authentication when request some web ...
    (microsoft.public.dotnet.framework.aspnet)