Forms redirect RRS feed

  • Question

  • User-1123086518 posted

    Hi there

    Within my application I currently have set up a login from a tutorial I found on the net. It works in the sense I can log in and am taken to correct pages. It uses role based authenication from SQL server. The problem lies in that when I run my program it wants me to log in straight away I can't access the top leve pages, ie index, contact etc unless I'm logged in. I'd want the user to be able to have access to all the top level files within my project except those that are under the 'Admin' folder, only logged in users should be able to log into these files. I'd imagine I have to amend web.config on the top level:

    			<add name="constr" connectionString="###" providerName="System.Data.SqlClient"/>
          <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
          <httpRuntime targetFramework="4.5"  />			
    		<authentication mode="Forms">
          <forms defaultUrl="~/Home.aspx" loginUrl="~/login.aspx" slidingExpiration="true" timeout="2880"></forms>
          <deny users="?" />	
        <siteMap enabled ="true" defaultProvider="SiteMap">
            <add name="SiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap" securityTrimmingEnabled="true" />		  
    		<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />

    Under my 'Admin' folder I also have another config file but I guess I don't need to change this:

    <?xml version="1.0"?>
    			<allow roles="Administrator"/>
    			<deny users="*"/>

    Anybody understand what I'm doing wrong?..



    Wednesday, November 5, 2014 1:20 PM