I don't want to get off on a rant here, but....

Avatar

Technology, Programming, Complaints, etc.

Articles tagged with 'asp.net'

You can have the Session but you have to know the secret knock

Was very perplexed by this issue, context was fine, but context.Session was null, until finding this StackOverflow post.

One better though if you don't need to write context.Session is to implement: System.Web.SessionState.IReadOnlySessionState instead, which is probably somehow cheaper.

Empty User Names despite authenticating successfully

Had an issue today where System.Web.HttpContext.Current.User.Identity.Name was returning String.Empty even though I was prompted to authenticate against the server when hitting the web page.  After a few Googles I realized it was because the web.config was set to <authentication mode="None"/>.  Changing it to "Windows" fixed the problem.  I've never understood what that web.config line did in the past, since Auth is done at the IIS level and ASP.NET shouldn't really care.  I guess now I know...