Web config file

Jellybaby

Newcomer
Joined
Feb 12, 2004
Messages
14
Hi

I have 2 login pages...one for students and one for admin...and 2 web configs, how do I code the web config files to ensure that students only access their pages and admin have access to all.

The layout of pages are;
root
-login
-web config
-adminlogin
-----/Folder Student - pages
-----/Folder admin - pages

I have vb forms authentication implemented which works fine.

Thanks in advance
 
I believe that by placing those web.config files in the local folders, it reads the local version first. I'm not totally sure, but I know that you can place web.configs in your wwwroot and this can be inherited by all sub projects...
 
Hi

Thanks for you reply...but do you know how to configure the web config file to ensure admin access?

Thanks
 
An application's configuration is inherited from its parent with redefinitions in the application's configuration file (web.config) overriding those inherited from the parent.

In your case you should have one login page, with one web.config file and location elements specifying who can access what.

Code:
<configuration>
   <location path="Logon.aspx">
      <system.web>
         <authorization>
            <allow users="?"/>
         </authorization>
      </system.web>
   </location>
</configuration>
 
Hi

Thanks for the reply...can you have select statements in the web config file e.g

<authorization>
<allow users="select * from tblAdmin"/>
</authorization>

As the problem I have is...I need to vertify the users against tblStudent and admin again tblAdmin. I have tried to do the select statement in the login page but it keeps returning errors.

Any help would be greatly appreciated
 
Back
Top