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
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
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!
This allows one page to act as a global login page, and no other page to load unless part of a session, created by a successful login comand from the login page. Much securer than passing query strings.
http://www.howtodothings.com/ViewArticle.aspx?Article=31
or
Site covering three tutorials on how to create images “on the fly” using asp.net
first create a new panel object and name it, set its width to 100% and clearout any text
then use..
Panelname.Controls.Add(new LiteralControl(“string”));
to add to it
on the page load event….
if(!IsPostBack)
{
//very first load//
}
else
{
//not first load//
}