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

SharePoint 2007 we can able to use the Httpcontext.current object But in SharePoint 2010 we are unable to get the httpcontext.current object. It will return the values.

How can i get the or Create the HttpContext.current object in SharePoint 2010. Even in Sharepoint 2007 we can able to access the SPContext.Current.Web object but in SharePoint 2010 we willn't able to do that why?

I need to Access either HttpContext.Current object or SpContext.Current.Web Object in Side the custom Membership provider.

I will be very thank full to you if you able to solve my problem.

I am implementing this on Custom Membership Provider.

Thanks in advance.

share|improve this question

In SharePoint 2010, custom membership providers must use claims-based auth. The reason you cannot access the current context is that your code is actually being executed by the Security Token Service, which is in a different web application than the content web application that where the request was received. You will need to look for a different solution to pass the state information.

share|improve this answer

I don't think it's possible to get a context object in your provider.
Maybe you could create a method in your provider with a parameter for the context. In your code-behind from the page, you should be possible to get the context-object and pass it through to the method in the provider. Don't know why you would need this though...

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.