Code On Time web applications designed for Internet access have an option to include a built-in Membership Manager. This tool works on top of Microsoft ASP.NET Membership to simplify user and role management in generated apps. It uses exactly the same data controller architecture as the rest of data controllers in a project.
Data controllers aspnet_Membership and aspnet_Roles are automatically created in a web application if the membership feature is enabled.
This is a typical view of Membership Manager presented if you sign in as admin and navigate to Membership page.
The data controller files can be changed in Visual Studio but the changes will be overwritten by the application generator.
Instead, consider the data controller virtualization when you need to modify the membership manager.
Select the project name on the start page of the generator and choose Develop option. Visual Studio will load the project for editing. Create a new code file Class1.cs(vb) under ~/App_Code/Security folder of your project.
Enter the following definition of the partial class MembershipBusinessRules to virtualize the data controller definition at runtime.
public partial class MembershipBusinessRules
public override bool SupportsVirtualization(string controllerName)
protected override void VirtualizeController(string controllerName)
// remove lookup capability from the field "UserId"
// select "grid1" view
// add data field "UserId"
// delete data field "Comment"
// select "grid1" view
// re-arrange the data fields
.ArrangeDataFields("UserUserName", "Email", "UserId");
Partial Public Class MembershipBusinessRules
Public Overrides Function SupportsVirtualization(controllerName As String) As Boolean
Protected Overrides Sub VirtualizeController(controllerName As String)
' remove lookup capability from the field "UserId"
' select "grid1" view, add data field "UserId", and delete data field "Comment"
' select "grid1" view and re-arrange the data fields
.ArrangeDataFields("UserUserName", "Email", "UserId")
The new partial class complements the standard class MembershipBusinessRulesBase included in the application framework. It is possible to override any standard methods such as SignUpUser or UpdateUser. The implementation above overrides the data controller virtualization methods only.
Save the code file and navigate to Membership Manager.
You will see the global unique ID of each user. The data field Comment is not visible anymore. The remaining data fields are re-arranged.