SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get the SPContext on the forms login page (/_forms/default.aspx)? Looking up SPContext.Current or SPContext.GetContext(HttpContext.Current) is always null. I need to retrieve the parent WebApplication and IIS Settings prior to logon in order to retrieve a Form Membership Provider within the SecurityTokenService Application's web.config.

I'm open to alternatives to identifying the current Web Application and Zone in order to retrieve the Forms Membership Provider.

share|improve this question
up vote 0 down vote accepted

The MembershipProvider and RoleProvider classes provide the name (this.Name) of the membership/role provider.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.