#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    8
    Rep Power
    0

    Angry Web.Config login path error (forms authentication)


    I am developing several hernias over the following problem
    --------------------

    I have started to upload a piece of a web app (ASP.NET and C#) which worked FINE on my localhost server. I am using Forms Authentication linked to an accessDB (i know i know....access...but its part of the specs) and it was working fine locally. Now it is uploaded to where it is being hosted (www.netpublisher.com) it has started to screw up. Whenever i try to access a protected page (and am not logged in) the UserLogin.aspx page is called from the wrong directory...

    It should call it from the /UserLogin.aspx directory but since i tried to access a page in the protected folder it tries to open /Protected/UserLogin.aspx (which of course doesnt exist)

    The VERY partially uploaded website is over at Small Business Press and just click on the User Login page on the side menu to get the error.

    Please give me any help you can, im new to .NET and this is really p*ssing me off.

    Cheers!

    -Mal

    WEB.CONFIG FILE
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    	<system.web>
    		<compilation defaultLanguage="c#" debug="true" />
    		<customErrors mode="Off" />
    		  <authentication mode="Forms">
                   <forms loginUrl="UserLogin.aspx" timeout="30"> <!--path="/"-->
                   <!-- <forms loginUrl="http://www.smallbusinesspress.net/UserLogin.aspx">
                   -->
                   </forms>
              </authentication>
              <authorization>
                   <allow users="?" />
              </authorization>
    		<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    		<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20" />
    		<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    	</system.web>
    	
    	<location path="protected">
    		<system.web>
    			<authorization>
    				<deny users="?" />
    			</authorization>
    		</system.web>
    	</location>
    	
    </configuration>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    8
    Rep Power
    0

    Talking


    its ok, i figured it out.

    i didnt know you could use the relative path mapping in the web.config file "~/"

    for all those who have this same problem, anything run serverside in asp.net picks up the "~" key as the AppPath directory string, so if you ever need to relatively access your root directory (like from user controls or something) as long as the object is runat="server" then the ~/ will work.


IMN logo majestic logo threadwatch logo seochat tools logo