ListCommandEventArgs ListCommandEventArgs ListCommandEventArgs ListCommandEventArgs Class

Definition

Warning

This API is now obsolete.

Provides data for the ItemCommand event of a List control. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public ref class ListCommandEventArgs : System::Web::UI::WebControls::CommandEventArgs
[System.Obsolete("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 class ListCommandEventArgs : System.Web.UI.WebControls.CommandEventArgs
type ListCommandEventArgs = class
    inherit CommandEventArgs
Public Class ListCommandEventArgs
Inherits CommandEventArgs
Inheritance
Attributes

Examples

The following code example shows how you can use the ListCommandEventArgs object to modify the status of tasks in a list when the item is clicked. This example is part of a larger example for the List overview.

Note

The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information, see ASP.NET Web Forms Page Code Model.

private void Status_ItemCommand(object sender, 
    ListCommandEventArgs e)
{
    const string spec = "You now have {0} " + 
        "tasks done, {1} tasks scheduled, and " +
        "{2} tasks pending.";

    // Move selection to next status toward 'done'
    switch (e.ListItem.Value)
    {
        case "scheduled":
            schedCount -= 1;
            pendCount += 1;
            e.ListItem.Value = "pending";
            break;
        case "pending":
            pendCount -= 1;
            doneCount += 1;
            e.ListItem.Value = "done";
            break;
    }

    // Show the status of the current task
    Label1.Text = e.ListItem.Text + " is " +
        e.ListItem.Value;

    // Show current selection counts
    Label2.Text = String.Format(spec, doneCount, 
        schedCount, pendCount);
}
Private Sub Status_ItemCommand(ByVal sender As Object, _
    ByVal e As ListCommandEventArgs)

    Const spec As String = "You now have {0} tasks done, {1} " & _
        "tasks scheduled, and {2} tasks pending."

    ' Move selection to next status toward 'done'
    Select Case e.ListItem.Value
        Case "scheduled"
            schedCount -= 1
            pendCount += 1
            e.ListItem.Value = "pending"
        Case "pending"
            pendCount -= 1
            doneCount += 1
            e.ListItem.Value = "done"
            
    End Select

    ' Show the status of the current task
    Label1.Text = e.ListItem.Text & " is " & _
        e.ListItem.Value

    ' Show current selection counts
    Label2.Text = String.Format(spec, doneCount, _
        schedCount, pendCount)
End Sub

Constructors

ListCommandEventArgs(MobileListItem, Object) ListCommandEventArgs(MobileListItem, Object) ListCommandEventArgs(MobileListItem, Object) ListCommandEventArgs(MobileListItem, Object)

Initializes a new instance of the ListCommandEventArgs class using the provided ListItem and CommandSource. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

ListCommandEventArgs(MobileListItem, Object, CommandEventArgs) ListCommandEventArgs(MobileListItem, Object, CommandEventArgs) ListCommandEventArgs(MobileListItem, Object, CommandEventArgs) ListCommandEventArgs(MobileListItem, Object, CommandEventArgs)

Initializes a new instance of the ListCommandEventArgs class using the given ListItem, CommandSource, and the original command arguments. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

Fields

DefaultCommand DefaultCommand DefaultCommand DefaultCommand

Sets or returns the name of the default command. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

Properties

CommandArgument CommandArgument CommandArgument CommandArgument

Gets the argument for the command.

(Inherited from CommandEventArgs)
CommandName CommandName CommandName CommandName

Gets the name of the command.

(Inherited from CommandEventArgs)
CommandSource CommandSource CommandSource CommandSource

Returns the control that raised the event. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

ListItem ListItem ListItem ListItem

Returns the list item that generated the event. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Security

AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.

Applies to

See also