本文介绍了DataPager在动态更改objectDataSource select方法后停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用DataPager,ListView和DataPager来显示我的数据,所有内容(强调分页)都没问题。我也改变了objectDataSource的select方法:



I used DataPager , ListView and DataPager to display my data , everything(emphatically paging) was OK .I also changed the select method of objectDataSource this way:

ObjectDataSource1.SelectMethod= "GetPruductByCondition";        
ObjectDataSource1.SelectParameters.Clear();
ObjectDataSource1.SelectParameters.Add("dropDownListValue", condition);
ObjectDataSource1.SelectParameters.Add("searchItem", searchItem);



也没关系。但是当我点击DataPager的另一页时,会显示以下错误:



ObjectDataSource'ObjectDataSource1'找不到非泛型方法


it was OK too. But when i click on another page of DataPager , error below is displayed:

"ObjectDataSource 'ObjectDataSource1' could not find a non-generic method

'GetProductList'

有参数:dropDownListValue,searchItem。



如何解决?

(这里是objectDatasource:

that has parameters: dropDownListValue, searchItem."

how can I solve it?
(here is objectDatasource :

<asp:ObjectDataSource ID="ObjectDataSource1" OldValuesParameterFormatString="original_{0}" SelectMethod="GetProductList" ...>





事实上我需要实现搜索,当点击SearchButton时,应该更改ObjectDataSource1的默认SelectMethod;这是第一次单击按钮我的实现工作但我无法使用DataPager查看其他搜索结果。

)

as a matter of fact I need to implement searching, and when the SearchButton is clicked the default SelectMethod of ObjectDataSource1 should be changed;for the first time the button is clicked my implementation works but I can not use DataPager to see other search results .

推荐答案


这篇关于DataPager在动态更改objectDataSource select方法后停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 21:30