I have an asp.net website which usercan post ads to it. So currently I am showing what ever the records in a DB in a datagridview.

I am just simply getting records to datatable and bind the table to gridview.

            dt_Display.Clear();
            dt_Display = Display_Bll.Get_Display();
            dlistDisplay.DataSource = dt_Display;
            dlistDisplay.DataBind();

Also I have an idea to generate hyperlinks for each of ad titles instead of above method. like this. dlistDisplay refer to Datalist.

            dt_Display.Clear();
            dt_Display = Display_Bll.Get_Display();
            dlistDisplay.DataSource = dt_Display;
            dlistDisplay.DataBind();

I used datalist to bind those records.

<asp:DataList runat="server" ItemStyle-Width="150" RepeatColumns="5" ID="dlistDisplay"
      RepeatDirection="Vertical"
      RepeatLayout="Table"
      Width="100%"
      >
      <ItemTemplate>
      <asp:HyperLink ID="hlDisplay" runat="server" Text='<%#Eval("title")%>' ForeColor="Blue"></asp:HyperLink>
       </ItemTemplate>
       </asp:DataList>

So my question for you.

If table have millions of records but assume that I am loading 300 records per page. what will be efficient.? Binding data to gridview or Generating 300 hyperlinks for page? ( Like doing in Craiglist.org )

Related posts

Recent Viewed