Jellybaby Posted February 20, 2004 Posted February 20, 2004 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 Quote
samsmithnz Posted February 20, 2004 Posted February 20, 2004 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... Quote Thanks Sam http://www.samsmith.co.nz
Jellybaby Posted February 20, 2004 Author Posted February 20, 2004 Hi Thanks for you reply...but do you know how to configure the web config file to ensure admin access? Thanks Quote
*Gurus* Derek Stone Posted February 20, 2004 *Gurus* Posted February 20, 2004 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. <configuration> <location path="Logon.aspx"> <system.web> <authorization> <allow users="?"/> </authorization> </system.web> </location> </configuration> Quote Posting Guidelines
Jellybaby Posted February 21, 2004 Author Posted February 21, 2004 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.