Inheriting a Profile from a Custom Class

Instead of defining a list of Profile properties in the web configuration file, you can define Profile properties in a separate class. For example, the class in Listing 28.26 contains two properties named FirstName and LastName.

Listing 28.26. App_Code\SiteProfile.cs

images

The class in Listing 28.26 inherits from the BaseProfile class.

After you declare a class, you can use it to define a profile by inheriting the Profile object from the class in the web configuration file. The web configuration file in Listing 28.27 uses the inherits attribute to inherit the Profile from the SiteProfile class.

Listing 28.27. ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.