objectdatasource search help
i have my ObjectDataSource1 setup to use with my GridView. If I want to setup a Search text box for the GridView will I need to create a new ObjectDataSource2 to tie it to the Search textbox?
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="ShelterExpress.ShelterData"
DataObjectTypeName="ShelterExpress.Shelter"
InsertMethod="InsertShelter"
UpdateMethod开发者_开发百科="UpdateShelter"
DeleteMethod="DeleteShelter"
SelectMethod="GetShelters"
OldValuesParameterFormatString="original_{0}">
<DeleteParameters>
<asp:Parameter Name="shelterId" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
You'll need to setup select parameters like you've done for delete. You'll use control parameters.
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" PropertyName="text" Direction="input" Name="filterField" type="string"/>
</SelectParameters>
精彩评论