Export (0) Print
Expand All

Command Class

Creates a user interface element that enables users to invoke ASP.NET event handlers and it provides a means to post user input from UI elements back to the server.

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

public ref class Command : public TextControl, IPostBackEventHandler, IPostBackDataHandler
public class Command extends TextControl implements IPostBackEventHandler, IPostBackDataHandler
public class Command extends TextControl implements IPostBackEventHandler, IPostBackDataHandler
Not applicable.

The Command control displays as an interactive UI element on the requesting device. The label of the UI element comes from the Text property, which is inherited from the TextControl base class.

Caution noteCaution:

Avoid using special characters in ASP.NET mobile Web page URLs. The HREF tags generated for posting Command events back to the server are not strictly validated. For example, a URL that includes spaces results in the generation of WML that cannot be handled by some WML browsers.

TopicLocation
Walkthrough: Creating Web Pages for Mobile DevicesBuilding ASP .NET Web Applications in Visual Studio

The following code example demonstrates how to attach command events. Clicking either of the Command buttons raises the OnItemCommand event. The user-defined function uses the CommandEventArgs argument to see which Command button was clicked.

NoteNote:

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

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show:
© 2014 Microsoft