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.
Assembly: System.Web.Mobile (in System.Web.Mobile.dll)
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class Command : public TextControl, IPostBackEventHandler, IPostBackDataHandler
<mobile:Command />
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: |
|---|
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. |
| Topic | Location |
|---|---|
| Walkthrough: Creating Web Pages for Mobile Devices | Building 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.
Note: |
|---|
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. |
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.UI::Control
System.Web.UI.MobileControls::MobileControl
System.Web.UI.MobileControls::TextControl
System.Web.UI.MobileControls::Command
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Caution:
Note: