語言

ListCommandEventHandler 代理人

定義

警告

The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.

代表將處理ItemCommandList事件的方法。 有關如何開發 ASP.NET 行動應用程式的資訊,請參閱 Mobile Apps &ASP.NET 的網站。

public delegate void ListCommandEventHandler(System::Object ^ sender, ListCommandEventArgs ^ e);
public delegate void ListCommandEventHandler(object sender, ListCommandEventArgs e);
[System.Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public delegate void ListCommandEventHandler(object sender, ListCommandEventArgs e);
type ListCommandEventHandler = delegate of obj * ListCommandEventArgs -> unit
[<System.Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")>]
type ListCommandEventHandler = delegate of obj * ListCommandEventArgs -> unit
Public Delegate Sub ListCommandEventHandler(sender As Object, e As ListCommandEventArgs)

參數

sender
Object

事件的源頭,一個 List 控制組。

e
ListCommandEventArgs

一個 ListCommandEventArgs 包含事件資料的物件。

屬性

備註

當你為控制組建立 ListCommandEventHandler 代理時,你會 List 確定處理該事件的方法。 當項目事件產生時,會 ListControl 通知處理器。 要將事件與你的事件處理器關聯,請將該代理的實例加入事件中。 除非移除代理,否則事件發生時會呼叫事件處理程序。

預設渲染時,控制項提供使用者點擊單一清單項目的介面。 在 postback 時,控制項呼叫 OnItemCommand 事件處理器,並有指向來源項目的參數。 該財產的 CommandName 價值為 null。

使用範本渲染時,ASP.NET 的事件冒泡機制會呼叫該 OnItemCommand 方法。 事件處理程序會被傳遞一個參數,指向來源項目及 CommandName 產生事件的控制項屬性。 這讓你能渲染一個包含多個相關互動的清單項目。

要將項目渲染成超連結,你可以將屬性設定 ItemsAsLinks 為 true。 屬性的 Text 值用於顯示, Value 選擇後屬性內容作為目標連結位址。

Note

這些連結不會產生指令事件。

擴充方法

名稱 Description
GetMethodInfo(Delegate)
已淘汰.

取得一個代表指定代理所代表方法的物件。

適用於

另請參閱