<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData" TypeName="ZWW.BLL.GovermentOpenTreeDateSource" MaximumRowsParameterName="pageSize" StartRowIndexParameterName="startIndex" EnablePaging="True" SelectCountMethod="GetTotal" DeleteMethod="DeleteGovernmentOpenTree"> <SelectParameters> <asp:ControlParameter ControlID="tb_treename" Name="tree_name" Type="String" /> <asp:ControlParameter ControlID="ddl_ptreeid" Name="p_tree_id" PropertyName="SelectedValue" Type="Int64" /> <asp:QueryStringParameter Name="TMP_ID" QueryStringField="TMP_ID" Type="Int64" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="TREE_ID" Type="Int64" /> </DeleteParameters> </asp:ObjectDataSource>
<SelectParameters>
<asp:ControlParameter ControlID="tb_treename" Name="tree_name" Type="String" />这是textbox传的值
<asp:ControlParameter ControlID="ddl_ptreeid" Name="p_tree_id" PropertyName="SelectedValue"
Type="Int64" />这是下拉列表传的值
<asp:QueryStringParameter Name="TMP_ID" QueryStringField="TMP_ID" Type="Int64" />这是跨页传递过来的值(Name是你接受的过来的名)
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="TREE_ID" Type="Int64" />这是ObjectDataSource删除函数中DeleteMethod="DeleteGovernmentOpenTree"
的参数,来源于Gridview的DataKeyNames="TREE_ID"
</DeleteParameters>