ListCommandEventArgs Classe

Definizione

Attenzione

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.

Fornisce i dati per l'evento ItemCommand di un controllo List. Per informazioni su come sviluppare applicazioni per dispositivi mobili ASP.NET, vedere App per dispositivi mobili & Siti con ASP.NET.

public ref class ListCommandEventArgs : System::Web::UI::WebControls::CommandEventArgs
public 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
[<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.")>]
type ListCommandEventArgs = class
    inherit CommandEventArgs
Public Class ListCommandEventArgs
Inherits CommandEventArgs
Ereditarietà
ListCommandEventArgs
Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come usare l'oggetto ListCommandEventArgs per modificare lo stato delle attività in un elenco quando viene fatto clic sull'elemento. Questo esempio fa parte di un esempio più grande per la List panoramica.

Nota

L'esempio di codice seguente usa il modello di codice a file singolo e potrebbe non funzionare correttamente se copiato direttamente in un file code-behind. Questo esempio di codice deve essere copiato in un file di testo vuoto con estensione aspx. Per altre informazioni, vedere Web Forms ASP.NET modello di codice pagina.

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

Costruttori

ListCommandEventArgs(MobileListItem, Object)
Obsoleti.

Inizializza una nuova istanza della classe ListCommandEventArgs utilizzando le classi ListItem e CommandSource fornite. Questa API è obsoleta. Per informazioni su come sviluppare applicazioni per dispositivi mobili ASP.NET, vedere App per dispositivi mobili & Siti con ASP.NET.

ListCommandEventArgs(MobileListItem, Object, CommandEventArgs)
Obsoleti.

Inizializza una nuova istanza della classe ListCommandEventArgs utilizzando le proprietà ListItem e CommandSource specificate, oltre agli argomenti del comando originali. Questa API è obsoleta. Per informazioni su come sviluppare applicazioni per dispositivi mobili ASP.NET, vedere App per dispositivi mobili & Siti con ASP.NET.

Campi

DefaultCommand
Obsoleti.

Imposta o restituisce il nome del comando predefinito. Questa API è obsoleta. Per informazioni su come sviluppare applicazioni per dispositivi mobili ASP.NET, vedere App per dispositivi mobili & Siti con ASP.NET.

Proprietà

CommandArgument
Obsoleti.

Ottiene l'argomento del comando.

(Ereditato da CommandEventArgs)
CommandName
Obsoleti.

Ottiene il nome del comando.

(Ereditato da CommandEventArgs)
CommandSource
Obsoleti.

Restituisce il controllo che ha generato l'evento. Questa API è obsoleta. Per informazioni su come sviluppare applicazioni per dispositivi mobili ASP.NET, vedere App per dispositivi mobili & Siti con ASP.NET.

ListItem
Obsoleti.

Restituisce l'elemento dell'elenco che ha generato l'evento. Questa API è obsoleta. Per informazioni su come sviluppare applicazioni per dispositivi mobili ASP.NET, vedere App per dispositivi mobili & Siti con ASP.NET.

Metodi

Equals(Object)
Obsoleti.

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()
Obsoleti.

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()
Obsoleti.

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()
Obsoleti.

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
ToString()
Obsoleti.

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a

Vedi anche