Data Controllers / Fields / Items Style

  User Name Lookup

Table of Contents
Data Controllers / Fields / Items StylePrint||
User Name Lookup

Data fields can be configured as a User Name Lookup to allow selection and insertion from the user names registered in the ASP.NET membership tables.

First, add an Owner column in the Orders table.

Start SQL Server Management Studio. In the Object Explorer, right-click on Databases / Northwind / Tables / dbo.Orders node, and select Design option.

Design the Orders table in the Northwind database using SQL Server Management Studio.

Add the following column:

Column Name Data Type Allow Nulls
OwnerName nvarchar(50) True

Save the table design. Switch to Code On Time web application generator, and refresh the Orders controller.

Refresh the Orders controller.

Generate the application. Navigate to the Orders page, and select a record. The Owner Name field will just be a simple text box. Let’s convert this text box into a User Name Lookup.

Owner Name field is currently a simple text box.

Start the Project Designer. In the Project Explorer, switch to the Controllers tab. Double-click on Orders / Fields / OwnerName field node.

OwnerName field in the Orders controller.

Change the Items Style property:

Property New Value
Items Style User Name Lookup

Press OK to save the field. On the toolbar, click Browse.

Navigate to the Orders page and edit a record. The Owner Name field will now be a lookup.

Owner Name field is now a User Name Lookup.

When you activate the lookup, a list of users will be displayed.

Activating a User Name Lookup will display a list of users.

Select a user, and the user name will be inserted into the field.

Selecting a user from the lookup will insert the User Name into the field.