Introduction to the Command Control
Thecontrol provides ASP.NET mobile Web pages with the ability to post user input to the server.
The appearance of the Command control varies depending on its property settings and the type of device in which it is being rendered. It can appear as a button, image, link, or softkey. A softkey is a programmable button available on many cell phones.
A Command control must be placed within a Form or Panel control, or inside a control's template on a mobile Web page. You can also drag it onto a mobile user control page. Use the Properties window to specify the value of the property, which determines the preferred visual appearance of the control. Set the property with the string that the Command control displays when it is rendered. If an application runs on a device that supports softkeys, the Command control displays the text contained in the property as the label for the softkey.
The Command control can display an image on devices that support images. Specify the URL for the image's location in theproperty.
Each Command control must have a name. Set its name with theproperty. When the user selects a Command control, it generates a event and invokes the method. In addition, it generates an event. The ItemCommand event is propagated to its parent controls. The Click event is not. Your application can provide handlers for these events.
Additionally, you can define argument values when you design your application. Do this by setting theproperty. When the application raises an ItemCommand event, it passes the value in the CommandArgument member of the parameter to the handler.
By default, the value of a Command control'sproperty is true. This causes the server to perform validation on all other controls in the same form. To disable this behavior, set CausesValidation to false.
Apply device filters to enable the use of property override values. By overriding property values, you can customize the appearance of Command controls for specific types of devices.
To configure the appearance of the Command control dynamically, your application can use data binding.