EDN Admin
Well-known member
An http://www.4guysfromrolla.com/articles/042804-1.aspx enumeration is a special type in the .NET Framework that is comprised of a number of named constants.
While you might not have created an enumeration type yourself, you have likely used enumerations many times in day-to-day programming. For example, the rows in a
GridView have a http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewrow.rowtype.aspx
property that returns an
enumeration of type http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datacontrolrowtype.aspx
that
indicates the rows type:
,
,
, and so on.
When working with an enumeration we may need to display a descriptive message based on the enumerations value. For example, using http://aspnet.4guysfromrolla.com/articles/120705-1.aspx ASP.NETs
Membership system you can programmatically create a new user account calling the http://msdn.microsoft.com/en-us/library/system.web.security.membership.aspx
class s http://msdn.microsoft.com/en-us/library/82xx2e62.aspx
method . This method specifies the success or failure of the
operation via the http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx
enumeration .
This enumeration has members like
,
,
,
, and the like. When
calling this method from an ASP.NET page you might want to show the user a descriptive message based on this enumeration value.
This article explores three different ways to provide descriptive text for enumeration members. Read on to learn more!
http://www.4guysfromrolla.com/articles/080410-1.aspx" class="readmore Read More >
View the full article
While you might not have created an enumeration type yourself, you have likely used enumerations many times in day-to-day programming. For example, the rows in a
GridView have a http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewrow.rowtype.aspx
Code:
RowType
enumeration of type http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datacontrolrowtype.aspx
Code:
DataControlRowType
indicates the rows type:
Code:
Header
Code:
Footer
Code:
DataRow
When working with an enumeration we may need to display a descriptive message based on the enumerations value. For example, using http://aspnet.4guysfromrolla.com/articles/120705-1.aspx ASP.NETs
Membership system you can programmatically create a new user account calling the http://msdn.microsoft.com/en-us/library/system.web.security.membership.aspx
Code:
Membership
Code:
CreateUser
operation via the http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx
Code:
MembershipCreateStatus
This enumeration has members like
Code:
Success
Code:
InvalidUserName
Code:
InvalidPassword
Code:
DuplicateUserName
calling this method from an ASP.NET page you might want to show the user a descriptive message based on this enumeration value.
This article explores three different ways to provide descriptive text for enumeration members. Read on to learn more!
http://www.4guysfromrolla.com/articles/080410-1.aspx" class="readmore Read More >
View the full article