SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MVC 2 Cutom Membership Role Provider

    MVC2, C#, IoC, DI, Unity and SQL Server 2008
    (still struggling with the keywords little bit ).

    I need to set up a custom member ship role provider. For this i need to

    * setup DB tables
    * front end logic

    I am looking for a tutorial that can walk me from A -> Z. I have googled but still have not come up with some thing that is a complete tutorial. There are bits and pieces scattered all across the web.

    Thanks
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  2. #2
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I am looking for a custom solution. The tables are already there. If i can then i'll use those, if these need updating then i have the permission from the client.
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Melbourne, Australia
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should be able to just create a subclass of MembershipProvider and RoleProvider, and put your logic into the overridden methods. You don't have to implement everything - Just throw a NotImplementedException() in all the methods you don't implement. After creating your custom subclasses, you set them in your Web.config

    Start with the MembershipProvider, and when you get that working, implement a RoleProvider. The bare minimum you need to implement for the MembershipProvider is the ValidateUser method (for logging in), and CreateUser and a few properties for registration (if you need registration)

    Is there any particular bit you're having issues with?

  4. #4


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •