SqlDataSourceView::FilterParameters Property
Gets a collection of parameters that are associated with any parameter placeholders in the FilterExpression string.
Assembly: System.Web (in System.Web.dll)
[PersistenceModeAttribute(PersistenceMode::InnerProperty)] public: property ParameterCollection^ FilterParameters { ParameterCollection^ get (); }
Property Value
Type: System.Web.UI.WebControls::ParameterCollectionA ParameterCollection that contains a set of parameters associated with any parameter placeholders found in the FilterExpression property.
The parameters in the FilterParameters collection are associated with any parameters that are specified in the FilterExpression property. The parameter placeholders that are specified in the FilterExpression are evaluated by order and matched to parameter objects in the FilterParameters collection when the Select method is called.
Security Note: |
|---|
You should validate any filter parameter value that you receive from the client. The runtime simply substitutes the parameter value into the filter expression and applies it to the DataView object that is returned by the Select method. If you are using the FilterExpression property as a security measure to limit the number of items that are returned, you must validate the parameter values before the filtering occurs. |
The following code example demonstrates how to retrieve data from the Northwind database and filter it using the FilterExpression and FilterParameters properties. The FilterExpression property of the SqlDataSource control is applied any time the Select method is executed to retrieve data. In this example, the FilterExpression property contains a placeholder for a filter parameter, which is contained in the FilterParameters collection. In addition, the filter parameter is a ControlParameter object that is bound to the SelectedValue property of the DropDownList control. Because the DropDownList control has its AutoPostBack property set to true, any change in the DropDownList selection causes the page to post information back to the server and the GridView control to rebind to the data source control with the new filter.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note: