TheEdge
TheEdge

Reputation: 9881

Adding paging to ListView using model binding

I am using .NET 4.5 and want to add paging to my ListView which is using model binding.

I have Googled and found the answer:

http://dotnet.learningtree.com/2012/11/30/efficient-paging-with-model-binding-in-web-forms/

However as the code snippets are done as images where the author says "When I add a new GetData() method, it creates a stub in the code-behind with an IQueryable..." I cannot see where that is added.

Can anyone point me in the right direction? All I am trying to do is add paging to my ListView that is model bound in an efficient fashion.

Upvotes: 1

Views: 932

Answers (1)

IDeveloper
IDeveloper

Reputation: 1299

Inside you <asp:ListView... tag type SelectMethod and you will get a method stub generator helper. If you press TAB it will create a method ListViewId_GetData in your code behind. The whole picture:

<asp:ListView SelectMethod="ListView1_GetData" ID="ListView1" runat="server">
</asp:ListView>

Code-behind:

public IQueryable ListView1_GetData()
{
    return null;
}

Upvotes: 1

Related Questions