what is the purpose of command name and command argument for a control example button?

后端 未结 7 1462
孤街浪徒
孤街浪徒 2021-02-07 09:57

what is the purpose of command name and command argument for a control example button? when should we go for this?

7条回答
  •  日久生厌
    2021-02-07 10:30

    With this you can pass in extra information when a button gets clicked. Notice that it's not the Click event that gets handled but the Command event.

    The place where it's mostly used is in combination with grid control in ASP.NET where standard messages are passed in like Delete, Insert, ... and which get handled in the default eventhandlers of these controls.

    For an overview of this, take a look here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx.

提交回复
热议问题