Thomas Sampson


Leave a comment

Master Page User

I recently found that the User object cannot be accessed directly from inside a master page (as it can from any standard aspx page). To do so you need the following code;

HttpContext.Current.User.Identity

Advertisements


3 Comments

Advanced Forms Authentication

Tonight I realised that with default forms authentication turned on, a linked css file (from a link tag in head) will not load on the login page before a user logs in, so the site has no css before the user logs in!!

Solution

right before the </configuration> in the web.config file add…

<location path=”myskin.css”>
<system.web>
<authorization>
<allow users=”*”>
</allow>
</authorization>
</system.web>
</location>

replace myskin.css with any file you wish to grant unauthorised access to! 🙂