EntityDataSource.Selecting 事件

定義

發生於查詢建構及執行之前。

public:
 event EventHandler<System::Web::UI::WebControls::EntityDataSourceSelectingEventArgs ^> ^ Selecting;
public event EventHandler<System.Web.UI.WebControls.EntityDataSourceSelectingEventArgs> Selecting;
member this.Selecting : EventHandler<System.Web.UI.WebControls.EntityDataSourceSelectingEventArgs> 
Public Custom Event Selecting As EventHandler(Of EntityDataSourceSelectingEventArgs) 

事件類型

備註

事件 Selecting 會在建構和執行查詢之前引發。 Selecting處理 事件,以在建構和執行查詢之前,從資料繫結控制項修改 EntityDataSource 或讀取或變更引數的組態。

Cancel 物件的 屬性 EntityDataSourceSelectingEventArgs 設定為 true 以取消查詢。 取消 SELECT 作業時,不會將資料傳回至資料繫結控制項。

如果在 AllowPaging 資料繫結控制項中設定為 true ,則會 EntityDataSource 使用 物件的 和 屬性值 DataSourceSelectArguments ,叫 SkipStartRowIndexTopMaximumRows 查詢產生器方法 ObjectQuery<T>

如果在 AllowSorting 資料繫結控制項中設定為 true ,當處理事件時 SelectingSortExpressionDataSourceSelectArguments 可以變更 物件的 。 引發事件之後 Selecting ,會套用在頁面標記中指定的任何其他查詢運算子,例如 WHERE 或 ORDER BY。

適用於