commandis the abstraction behind menu items, buttons, and links. Once a command is defined, other parts of the interface can refer to the same command, allowing many access points to a single feature to share aspects such as the disabled state.
- The command element is meant to encapsulate something that you can do. It can be rendered within a menu (since a menu presents items you can invoke).
- It provides an abstraction layer between UI and commands, so that you can make multiple UI elements refer to the same command.
- This gives you the flexibility of having one command element, rendered in a menu, that is also invoked via a URL in the middle of the page as well as a button at the bottom of the page. Disabling the command disables all access paths (url/button/menu) to the action behind the command.
<command>element is meant to be an abstraction to let you refer to the same "command" from multiple menu entries or buttons.
- The <command> is supported only in IE9 browser.
Example 1 :
Imp Point :
If you disable the command element using:
In disabling the command element using above code, it would disable all the controls referring to this command element.