DynamicFilterExpression DynamicFilterExpression DynamicFilterExpression DynamicFilterExpression Class

定義

使用所指定篩選控制項中的值,修改資料庫查詢。Modifies a database query by using a value from specified filter control.

public ref class DynamicFilterExpression : System::Web::UI::WebControls::Expressions::DataSourceExpression
public class DynamicFilterExpression : System.Web.UI.WebControls.Expressions.DataSourceExpression
type DynamicFilterExpression = class
    inherit DataSourceExpression
Public Class DynamicFilterExpression
Inherits DataSourceExpression
繼承
DynamicFilterExpressionDynamicFilterExpressionDynamicFilterExpressionDynamicFilterExpression

範例

下列範例顯示如何使用DynamicFilterExpression控制項, 在頁面中選取篩選範本。The following example shows how to use the DynamicFilterExpression control to select a filter template in a page. 篩選範本是由DynamicFilter DynamicFilterExpression控制項透過其ControlID屬性所識別。The filter template is selected by the DynamicFilter control that is identified by DynamicFilterExpression control through its ControlID property.

<asp:QueryExtender ID="QueryExtender1"   
    TargetControlID="GridDataSource" runat="server">  
    <asp:DynamicFilterExpression ControlID="CategoryFilterID" />  
</asp:QueryExtender>  

備註

類別可讓您使用DynamicFilter在控制項中指派的值來修改資料庫查詢。 DynamicFilterExpressionThe DynamicFilterExpression class enables you to modify a database query using the values that are assigned in a DynamicFilter control. 這個控制項會將建立IQueryable查詢的工作委派給特殊控制項, QueryableFilterRepeater例如控制項或DynamicFilter控制項。This control delegates the task of building of the IQueryable query to a specialized control such as QueryableFilterRepeater control or DynamicFilter control.

接著, 篩選控制項會將查詢的建立委派給它們所參考的篩選範本。The filter controls in turn delegate the building of the query to the filter template that they reference. 然後, 此查詢會由QueryExtender控制項所參考的資料來源控制項來執行。The query is then executed by the data source control that is referenced by the QueryExtender control.

若要在DynamicFilterExpression頁面中使用類別, 請遵循下列步驟:To use the DynamicFilterExpression class in a page, you follow these steps:

在先前的步驟中, 會假設相關的篩選控制項、資料繫結控制項和資料來源控制項都定義于頁面中。In the previous steps it is assumed that the related filter controls, data-bound controls, and data source control are defined in the page.

建構函式

DynamicFilterExpression() DynamicFilterExpression() DynamicFilterExpression() DynamicFilterExpression()

初始化 DynamicFilterExpression 類別的新執行個體。Initializes a new instance of the DynamicFilterExpression class.

屬性

Context Context Context Context

取得擁有者控制項的 HttpContext 執行個體。Gets the HttpContext instance of the owner control.

(Inherited from DataSourceExpression)
ControlID ControlID ControlID ControlID

取得或設定篩選控制項識別項。Gets or sets the filter control identifier.

DataSource DataSource DataSource DataSource

取得與擁有者控制項相關聯的資料來源物件。Gets the data source object that is associated with the owner control.

(Inherited from DataSourceExpression)
IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState

當由類別實作時取得值,這個值指出資料來源運算式物件是否正在追蹤其檢視狀態變更。When implemented by a class, gets a value that indicates whether a data source expression object is tracking its view state changes.

(Inherited from DataSourceExpression)
IsTrackingViewState IsTrackingViewState IsTrackingViewState IsTrackingViewState

取得值,這個值指出資料來源運算式物件是否正在追蹤其檢視狀態變更。Gets a value that indicates whether a data source expression object is tracking its view state changes.

(Inherited from DataSourceExpression)
Owner Owner Owner Owner

取得擁有者控制項。Gets the owner control.

(Inherited from DataSourceExpression)
ViewState ViewState ViewState ViewState

取得 StateBag 類別的執行個體,這個執行個體包含目前的檢視狀態資訊。Gets an instance of the StateBag class that contains the current view state information.

(Inherited from DataSourceExpression)

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetQueryable(IQueryable) GetQueryable(IQueryable) GetQueryable(IQueryable) GetQueryable(IQueryable)

取得使用目前的篩選值所修改的查詢。Gets the modified query using the current filter value.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
LoadViewState(Object) LoadViewState(Object) LoadViewState(Object) LoadViewState(Object)

載入 DataSourceExpression 物件中必須保存的值狀態。Loads the state of the values in the DataSourceExpression object that must be persisted.

(Inherited from DataSourceExpression)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
SaveViewState() SaveViewState() SaveViewState() SaveViewState()

儲存 DataSourceExpression 物件的目前檢視狀態。Saves the current view state of the DataSourceExpression object.

(Inherited from DataSourceExpression)
SetContext(Control, HttpContext, IQueryableDataSource) SetContext(Control, HttpContext, IQueryableDataSource) SetContext(Control, HttpContext, IQueryableDataSource) SetContext(Control, HttpContext, IQueryableDataSource)

使用資料來源資訊初始化運算式。Initializes the expression with data source information.

SetDirty() SetDirty() SetDirty() SetDirty()

標記 DataSourceExpression 物件,以便將其狀態儲存在檢視狀態中。Marks the DataSourceExpression object so that its state will be saved in view state.

(Inherited from DataSourceExpression)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
TrackViewState() TrackViewState() TrackViewState() TrackViewState()

追蹤 DataSourceExpression 物件的檢視狀態變更,以便該變更可針對資料來源運算式物件儲存到 StateBag 物件中。Tracks view state changes of the DataSourceExpression object so that the changes can be stored in the StateBag object for the data source expression object.

(Inherited from DataSourceExpression)

明確介面實作

IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object)

當由類別實作時,載入資料來源運算式物件先前儲存的檢視狀態。When implemented by a class, loads the previously saved view state of the data source expression object.

(Inherited from DataSourceExpression)
IStateManager.SaveViewState() IStateManager.SaveViewState() IStateManager.SaveViewState() IStateManager.SaveViewState()

當類別實作時,儲存 DataSourceExpression 物件的目前檢視狀態。When implemented by a class, saves the current view state of the DataSourceExpression object.

(Inherited from DataSourceExpression)
IStateManager.TrackViewState() IStateManager.TrackViewState() IStateManager.TrackViewState() IStateManager.TrackViewState()

當由類別實作時,追蹤 DataSourceExpression 物件的檢視狀態變更,以便該變更可針對資料來源運算式物件儲存到 StateBag 物件中。When implemented by a class, tracks view state changes of the DataSourceExpression object so that the changes can be stored in the StateBag object for the data source expression object.

(Inherited from DataSourceExpression)

適用於

另請參閱