beautypg.com

Create a dynamic asp.net menu – Adobe Dreamweaver CS3 User Manual

Page 694

background image

DREAMWEAVER CS3

User Guide

687

For more information on the properties of each control, see the documentation on the Microsoft website at

http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconaspsyntaxforwebcontrols.asp

.

3

To set more properties or events, click the Tag Editor button in the Property inspector, and set the properties in

the tag editor.

Create a dynamic ASP.NET menu

You can dynamically populate an ASP.NET menu control such as DropDownList or ListBox with entries from a
database.

Note: Before you begin, you must define a DataSet or other source of dynamic content for the menu.

1

Open the ASP.NET page and position the insertion point where you want the menu to appear.

2

Select Insert > ASP.NET Objects; then select asp:DropDownList or asp:ListBox.

3

Set the form control’s options, and click OK.

Dreamweaver inserts the form control at the insertion point in your page. If you didn’t insert a form, Dreamweaver
inserts one that includes a

runat=”server”

attribute.

See also

“Defining sources of dynamic content” on page 547

“Modify the properties or events of ASP.NET form controls” on page 686

“Make an existing ASP.NET menu dynamic” on page 688

ASP.NET DropDownList options

ID

Specifies the name you want to give the form control. The ID is required.

DataSet

Specifies the data source you want to use to populate the items of the list control. If you don’t specify a

DataSet, you can specify one later or set the list items statically by clicking the List Items button in the Property
inspector.

Get Labels From

Specifies the field in the selected DataSet to provide the labels of the list items.

Get Values From

Specifies the field in the selected DataSet to provide the values of the list items.

Select Value Equal To

Specifies a value the server uses to determine which list item is selected when the

DropDownList is displayed in a browser. The server compares each item’s value to the specified value. If the values
match, the matching item is selected.

Access Key

Creates a keyboard shortcut that allows users to quickly navigate to the form control in a browser. For

example, if you enter K, the user can navigate to the control by typing Alt+K. The access key can only consist of a
single character.

Auto Postback

Indicates whether a postback to the server automatically occurs when the user changes the list

selection. Select the option to allow postbacks.

For more information on ASP.NET DropDownList properties, see the documentation on the Microsoft website at

http://msdn.microsoft.com/library/en-us/cpgenref/html/cpcondropdownlistwebservercontrol.asp

.

ASP.NET ListBox options

ID

Specifies the name you want to give the form control. The ID is required.

September 4, 2007