selectMethod中的ObjectDataSource问题 [英] ObjectDataSource problem in selectMethod

查看:80
本文介绍了selectMethod中的ObjectDataSource问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出什么问题了?我收到错误消息,因为

ObjectDataSource"SearchResultDataSource"找不到具有参数:maximumRows,startRowIndex的非泛型方法"GetSearchResults".

这是我的ODS:

Whats the problem? I am getting error as

ObjectDataSource ''SearchResultDataSource'' could not find a non-generic method ''GetSearchResults'' that has parameters: maximumRows, startRowIndex.

This is my ODS:

<asp:ObjectDataSource ID="SearchResultDataSource" runat="server" TypeName="FocusCareer.Explorer.WebCareer.SearchResultView"
   EnablePaging="True"  SelectMethod="GetSearchResults" >
</asp:ObjectDataSource>



我的ListView如下:



My ListView as below:

<asp:ListView ID="SearchResultListView" runat="server" ItemPlaceholderID="SearchResultPlaceHolder"
                           DataSourceID="SearchResultDataSource" >



背后的代码:



code behind:

public List<SearchResultView> GetSearchResults(int startRowIndex, int maximumRows)
{
    var pageIndex = ((int)Math.Floor((double)startRowIndex / maximumRows));

    List<SearchResultView> searchResults = GetJobSeekerReferrals(pageIndex, maximumRows);
    _searchResultCount = searchResults.Count();

    return searchResults;
}

推荐答案

看看

<asp:ObjectDataSource ID="SearchResultDataSource" runat="server" TypeName="FocusCareer.Explorer.WebCareer.SearchResultView"

    EnablePaging="True"  SelectMethod="GetSearchResults" >
 </asp:ObjectDataSource>




我在"TypeName"中犯了错误




I did mistake in ''TypeName''

TypeName="FocusCareer.Explorer.WebCareer.JobSearchResults"

是正确的.


这篇关于selectMethod中的ObjectDataSource问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆