Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 25th, 2008, 05:25 PM
Authorized User
 
Join Date: Apr 2008
Location: , , .
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom Membership provider question

Hi:

For the membership providers that ship with ASP.NET 3.5, where is the class file located with all the properties and functions? I want to see how all the methods are written and to customize those methods with my own code.

I know i could for example, create a seperate class file and write the following:

public class xmlMembershipProvider inherits membershipProvider

and it would give me a list of all the functions and properties associated with the file.


I would, however, like to see the source class and all the completed functions and properties..

any help?

  #2 (permalink)  
Old July 25th, 2008, 05:28 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look here: http://weblogs.asp.net/scottgu/archi...13/442772.aspx

You can download the full source...

Imar
  #3 (permalink)  
Old July 27th, 2008, 09:44 AM
Authorized User
 
Join Date: Apr 2008
Location: , , .
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi:

Thanks!

Another question, maybe others are having the same thoughts:

For example, say if I want to add an extra field to the login control
such as a PIN number. How would you go about configuring the sqlmembership provider to work with that new field, as well as the new field you would have to add to the database? How does the sqlmembership provider know to work with a new field in the database? How would you go about setting that up?

Best,
aspC



  #4 (permalink)  
Old July 27th, 2008, 09:59 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

There are a few ways to do this. First, you could create your own provider and then extend the MembershipUser class and add new properties.

For more info: http://fredrik.nsquared2.com/viewpost.aspx?PostID=322

However, I find this not intuitive to work with. Instances of MembershipUser returned from the Membership API are returned as MembershipUser, not your custom type, so you always need to remember to cast the return value into your own type.

IMO, it's much easier to use Profile for this. For more info:

http://weblogs.asp.net/scottgu/archi...18/427754.aspx

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Membership Provider Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 1st, 2008 05:16 PM
Custom Membership Provider kulkarnimonica ASP.NET 2.0 Professional 0 June 21st, 2007 03:56 PM
problem with custom membership provider hertendreef ASP.NET 2.0 Professional 8 April 17th, 2007 12:11 PM
Issue with custom membership provider cacaldo ASP.NET 2.0 Professional 1 October 7th, 2006 03:05 AM
custom membership provider msrnivas General .NET 1 September 18th, 2005 04:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.