I am using a custom membership provider (forms auth) for SharePoint 2010. I am trying to build a web part that will allow an administrator to create a new account via my custom provider. I have code for this that runs perfectly in an ASP.NET application (external to SharePoint). Now, When I try to add a user from the web part:
MembershipProvider mp = Membership.Providers["MyProvider"];
MembershipCreateStatus status;
mp.CreateUser(<USER INFO HERE>, out status);
It gives me a status of "Provider Error."
When I call "GetAllUsers," it throws the good old: {"Object reference not set to an instance of an object."}
Does anyone have any ideas or any experience using a custom membership provider from a web part?