我有一個ObjectDataSource,我試圖傳遞一些參數。爲什麼ObjectDataSource不能發送正確的參數值?
GridDataSource.SelectMethod = "GetAllCountries";
GridDataSource.SelectParameters.Add("PageSize", pageSize.ToString());
GridDataSource.SelectParameters.Add("OrderBy", orderBy);
GridDataSource.SelectParameters.Add("StartIndex", startIndex.ToString());
和我的方法是在App_Code文件/ DAL/CountriesDB.CS
public List<Countries> GetAllCountries(int PageSize,string OrderBy,int StartIndex)
{
..........
}
當我調試它,在GetAllCountries方法每頁= -1;排序依據= 「」,開始索引= 0被傳遞。 ..這裏發生了什麼??
事先日Thnx ...
得到一個錯誤: 選擇操作,除非指定SelectMethod是不是由ObjectDataSource控件「GridDataSource」的支持。 –
@TamalKantiDey您需要如此指定它。編輯我的帖子。 –
是啊...試了....不工作.... –