ASP.NET

1. ASP.NET Introduction 2. Comp of .Net Framework 3.5 3. Sys.Req for VS 2008 4. ASP.NET Envrmnt Setup 5. VS2010 Ultimate Sys.Req 6. Installing VS 2010 7. VS 2012 Sys.Req 8. Installing VS Exp 2012 9. Start the VS 2008 10. Application Life Cycle 11. Page Life Cycle 12. Page Life Cycle Events 13. ASP.NET Example 14. Event Handling 15. Default Events 16. Server Side 17. Request Object 18. Response Object 19. Server Controls 20. Server Controls Properties 21. Server Controls Methods 22. HTML Server Controls 23. Client Side 24. ASP.NET Basic Controls 25. TextBox Control 26. CheckBox Controls 27. RadioButton Controls 28. ListBox Control 29. HyperLink Control 30. Image Control 31. BulletedList Control 32. ASP.NET Directives 33. Implements Directive 34. Master Type Directive 35. Page Directive 36. PreviousPage Type 37. Managing State 38. Control State 39. Cookies 40. Query Strings 41. Server-Side State 42. Session State 43. Validation Controls 44. Required FieldValidator 45. Range Validator 46. Compare Validator 47. RegularExpressionValidator 48. Custom Validator 49. Validation Summary 50. Data Source Control 51. AdRotator Control 52. Calendar Control 53. Calendar Control Example 54. Panel Control 55. Panel Control Example 56. Multi Views Control 57. MultiView & View controls 58. MultiView Control Example 59. FileUpload Control 60. FileUpload Control Eg 61. AJAX Control 62. UpdatePanel control 63. UpdateProgress Control 64. Custom Controls 65. Custom Control Eg 66. Personalization 67. Create Simple Profile 68. ADO.NET 69. ADO.NET Objects 70. DataTable 71. DataRow 72. DataColumn 73. Object Example 74. Error Handling 75. Tracing Errors 76. Debugger 77. Security 78. Authentication 79. Authorization 80. LINQ 81. LINQ Query Operators 82. LINQ Example 83. Caching 84. Data Caching 85. Output Caching 86. Object Caching 87. Web Services 88. Create Web Services Eg 89. Web & Machine.config 90. Settings Schema 91. ASP.NET Deployment 92. XCopy Deployment 93. Web Setup Project 94. ASP Interview Part 1 95. ASP Interview Part 2 96. ASP Interview Part 3 97. ASP Interview Part 4 98. ASP Interview Part 5 99. ASP Interview Part 6
Pr.Pg Next Pg

Example for Creating Simple Profile Properties tutorials

  • We can define simple properties as direct children of the <properties> element using an <add /> element.

  • The following example demonstrates how to create a property that can be used to hold a user’s first name and one to hold a date of birth. The FirstName property can be accessed and set for anonymous users as well, whereas the date of birth property is only accessible to logged-in users:

 

<system.web>

...

<profile>

<properties>

<add name=”FirstName” allowAnonymous=”True” />

<add name=”DateOfBirth” type=”System.DateTime” />

</properties>

</profile>

</system.web>

</configuration>

 

  • Because properties are by default of type System.String, there’s no need to define an explicit type on the property for simple properties like a first name. However, for other types like a DateTime, a Boolean, or an Integer, you need to define the type explicitly using the type attribute and its fully qualified name including its namespace.

  • The following table lists the most common attributes of the <add /> element that influence the properties of a profile.

 

Attributes

Description

allowAnonymous

This attribute specifies whether the property can be set for anonymous users. The default is False. To set this attribute to True, you also need to enable anonymousAuthentication

defaultValue

This attribute defines the default value for the property if it hasn’t been set explicitly. When you leave out this attribute, the profile property has as its default value the default value for the underlying type (for example null

for a String, 0 for an Int32, and so on).

name

This attribute defines the name of the property, like FirstName, DateOfBirth, and so forth.

readOnly

This attribute specifies whether the profile property can be changed at runtime. The default is False which means you can read from and write to the property.

type

This attribute sets the full .NET type name of the property, like System.String, System.Boolean, System.DateTime, and so on.

 

Example for Creating Profile Groups

  • Profile groups serve two distinct purposes: first, they allow you to logically group related properties.

  • For example, you can create a group called Address that in turn has properties like Street, PostalCode, and City.

  • Groups also allow you to have properties with the same name, but located in a different group.

  • For example, you can have two groups called VisitAddress and PostalAddress that both feature properties like Street and PostalCode, making it easier for a developer using your Profile object to find the relevant information.

  • To create a profile group you add a <group> element to the <properties> element of your profile and then specify a name. The <group> element then contains one or more simple properties.

  • The following example shows a profile group for a PostalAddress:

 

<properties>

<add name=”FirstName” />

<group name=”PostalAddress”>

<add name=”Street”/>

<add name=”PostalCode”/>

<add name=”City”/>

<add name=”Country”/>

</group>

</properties>

 

  • You can have multiple groups within the <properties> tags, but you can only have one level of groups. This means that you can’t nest a <group> element in another <group> or <add /> element.

 

Pr.Pg border                                              Next Pg