What is the difference between click and command events?

Source: Internet
Author: User

What is the difference between click and command events?

When a user clicks a button, it first processes the click and then the command. In fact, the commandname and commandargument attributes are defined only to pass (bubble) related events to the parent control. If the parent control does not trigger the command event, it makes the user more clear. The click and command events of the button are redundant, so you can leave it blank. For obtaining the commandname or commandargument attribute in the click event, write:

(Button) sender). commandname (button) sender). commandargument

You can do this without obtaining the button attributes only in the command event, but not in the click event. In fact, any attribute in the click event can be obtained.

Click is a direct click button, while command generally has a template column. If you use a button in a gridview for update, insert, delete, and so on. You cannot obtain the data of the selected items in the table by clicking the button. Commandname can be used to start the event in the upper-level space of the button. That is, use the update, insert, delete... event of the gridview.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.