Kok Leong Fong
Kok Leong Fong

Reputation: 241

NotSupportedException - Membership.GetAllUsers

My code is fairly simple.

   var member = Membership.GetAllUsers();

It throws "NotSupportedExpcetion" when this line is executed. I am trying to retrieve a list of users and populate on the web ui. Thank you.

Upvotes: 0

Views: 626

Answers (2)

user3476831
user3476831

Reputation: 1

try this

public ActionResult GetUser()
    {

    UsersContext oModel = new UsersContext();

    return View(oModel.UserProfiles.ToList());

    }

get all users which were registered using simpleMemberShipProvider [ mvc 4]

Upvotes: 0

angularsen
angularsen

Reputation: 8678

You might be using the default SimpleMembership provider in MVC4? It does not support GetAllUsers() among many other things. My solution has often been to roll my own.

Upvotes: 1

Related Questions