Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ListCommandEventHandler Delegate
Collapse the table of content
Expand the table of content

ListCommandEventHandler Delegate

Note: This API is now obsolete.

Represents the method that will handle the ItemCommand event of a List. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site.

Namespace:  System.Web.UI.MobileControls
Assembly:  System.Web.Mobile (in System.Web.Mobile.dll)

[ObsoleteAttribute("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public delegate void ListCommandEventHandler(
	Object sender,
	ListCommandEventArgs e
)

Parameters

sender
Type: System.Object

The source of the event, a List control.

e
Type: System.Web.UI.MobileControls.ListCommandEventArgs

A ListCommandEventArgs object that contains the event data.

When you create a ListCommandEventHandler delegate for a List control, you identify the method that will handle the event. The ListControl notifies the handler when an item event is generated. To associate the event with your event handler, add an instance of the delegate to the event. Unless you remove the delegate, the event handler is called whenever the event occurs.

For default rendering, the control provides a UI that allows the user to click individual list items. On postback, the control calls the OnItemCommand event handler, with an argument pointing to the source item. The value of the CommandName property is null.

When rendering with a template, the event bubbling mechanism of ASP.NET calls the OnItemCommand method. The event handler is passed a parameter, pointing to the source item, and to the CommandName property of the control that generated the event. This allows you to render a single list item with multiple associated interactions.

To render an item as a hyperlink, you can set the ItemsAsLinks property to true. The value of the Text property is used for display, and the contents of the Value property are used as the target link address when selected.

NoteNote

Command events will not be generated for these links.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4
Show:
© 2015 Microsoft