Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6596021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:01:03+00:00 2026-05-25T18:01:03+00:00

The .aspx: <asp:GridView ID=gvFirst runat=server AutoGenerateColumns=false AllowPaging=true ondatabound=gvFirst_DataBound > <Columns> <asp:BoundField DataField=ID HeaderText=ProductID/> <asp:BoundField

  • 0

The .aspx:

 <asp:GridView ID="gvFirst" runat="server" AutoGenerateColumns="false" 
        AllowPaging="true" 
        ondatabound="gvFirst_DataBound" >
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ProductID"/>
            <asp:BoundField DataField="Name" HeaderText="ProductName" />
        </Columns>
        <PagerTemplate>
            <asp:Panel ID="pnlPager" runat="server">
            </asp:Panel>
        </PagerTemplate>
    </asp:GridView>

The .cs:

 public class Productinformation
    {
     public int PID
     {
         get;
         set;
     }
     public string PName
     {
         get;
         set;
     }
    }
       using (NorthWindDataContext _NorthWindDataContext = new NorthWindDataContext())
        {
            Proinfo = new List<Productinformation>();
            Proinfo = (from p in _NorthWindDataContext.Products
                       select new Productinformation
                       {
                           PID = p.ProductID,
                           PName = p.ProductName,
                       }).ToList();

            gvFirst.DataSource =  Proinfo.Take(PageSize) ;
            gvFirst.DataBind();
        }

Proinfo variable is declared globally. Now When i run this code, it shows me the following error :

the data source does not support server-side data paging

If i use var type of variable then it is worked but
we can’t declare var type of variable globally,so if i used it, then i have to call this method every time in paging. and i don’t want to use Objectdatasource.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:01:04+00:00Added an answer on May 25, 2026 at 6:01 pm

    You must return a List to the gvFirst using ToList() method. So try this:

    gvFirst.DataSource =  Proinfo.Take(PageSize).ToList();
    

    Explanation:

    Because on the gvFirst you set the property AllowPaging="true" than the paging can be used with any data source object that implements ICollection interface.

    ProInfo.Take(PageSize) returns an IEnumerable and this is why you need to call the ToList() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<asp:GridView ID=GridView2 runat=server AllowPaging=True AllowSorting=True AutoGenerateColumns=False DataSourceID=LinqDataSource1> <Columns> <asp:BoundField DataField=UserName HeaderText=User Name ReadOnly=True SortExpression=UserName
<asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False BackColor=White BorderColor=#CC9966 BorderStyle=None BorderWidth=1px CellPadding=4> <Columns> <asp:BoundField DataField=FileID HeaderText=FileID />
<asp:GridView ID=gvBlockUnblock runat=server AutoGenerateColumns=False BackColor =AliceBlue onrowdatabound=gvBlockUnblock_RowDataBound DataKeyNames=CPID,PUBLISHED style=margin-top: 0px AllowPaging=True onpageindexchanging=gvBlockUnblock_PageIndexChanging PageSize=10 EnableViewState=
I have the following structure in an aspx page: <asp:Panel ID=pnlCust runat=server> <asp:GridView ID=gvMaster
<asp:GridView ID=GridView1 runat=server> <Columns> <asp:TemplateField HeaderText=FileName> <ItemTemplate> <asp:HyperLink ID=HyperLink1 runat=server NavigateUrl= Text=></asp:HyperLink> </ItemTemplate> </asp:TemplateField>
<asp:GridView ID=GridView1 runat=server CssClass=style29> <Columns> <asp:TemplateField HeaderText=Send Message to Group> <ItemTemplate> <asp:LinkButton ID=LinkButton2 runat=server
ASPX Code <asp:RadioButtonList ID=rbServer runat=server > <asp:ListItem Value=<%=ServerDeveloper%>> Developer </asp:ListItemv <asp:ListItem Value=dev.ahsvendor.com> dev.test.com</asp:ListItem> <asp:ListItem
I have a this aspx-code: (sample) <asp:DropDownList runat=server ID=ddList1></asp:DropDownList> With this codebehind: List<System.Web.UI.WebControls.ListItem> colors
//code in aspx. </asp:TemplateField> : : : <ItemTemplate> <asp:DropDownList ID=didDdl runat=server DataSourceID=departmentsDataSource DataTextField=Department DataValueField=DepartmentID
I have this code in my aspx page: <form id=form2 runat=server> <asp:ScriptManager ID=ItemsScriptManager runat=server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.