.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with datalist paging

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net

I having a little problem to get the paging for my datalits to work. I have used this article: http://aspalliance.com/157 which i found do the things i wanted. I have implemented the code but no records show at all.. No errors.. Can anybody see what i have done wrong? Thank you!

Here is my aspx code:

<h2 align="center"><font face="verdana">Paging in DataList</font></h2>
<a name="this"></a>

<asp:DataList ID="dList" Runat="server" Width="100%"

<table width="100%" style="font: 10pt verdana" cellpadding=0 cellspacing=0>
<tr style="background-color:FF0000">
<th align=left><font color="#FFFFFF">Store ID</font></th>
<th align=left><font color="#FFFFFF">Order Number</font></th>

<tr style="background-color:#f5f5dc">
<td><%#DataBinder.Eval(Container.DataItem, "pName")%></td>

View Complete Post

More Related Resource Links

datalist image slide show problem


hi friends

i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />

I above code works perfectly and the slide show e

ASP.NET Grid View Paging and GridDataRowBound Problem -



I have a problem displaying data in a Grid View control when I set a row to visible = false when a certain condition is true.

For example, if a DataRowData value has a condition set to true (custom in table) I set the visible property to false, so the data row will not be visible at run time.

The problem is that I'm using paging (10 rows per page) and if 8 of those rows fall into the true condition that won't show the row, that grid view page will only show two rows of data in page 1. The worst scenario is that if I go to page 2 of the grid view and all the rows (10) fall into the true condition, that grid view page will not show any data at all.

How can I show 10 rows of data at all times in a gridview? In other words, I would like to just show the visible rows at all times.

Any help will be greatly appreciated.


datalist printOut() function Problem

  • i m using below code..by using it i able to write asp data into word file n format it.but i m facing problen in print out..

    it show exception

    Message = "The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))"

    please hav a look at below code....

  •  .................div data...................   
  •   <div id="printdiv" runat="server">   
  •     <table style="border: 5px solid #FF00FF; width:100%">   
  •     <tr>   

  • DataList and DetailsView problem

    I have a problem hooking up the datalist to the details view. I know everything server side is fine cause the default values work, but I guess I am not getting post back from the datalist. Here is my code.<div id="thumbnail">                     <asp:DataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource2"                          RepeatDirection="Horizontal" DataKeyField="ItemsID">                         <ItemTemplate>                             <asp:ImageButton ID="Image1" runat="server" ImageUrl='<%# "Handler.ashx?ItemsID=" + Eval("ItemsID")%>'/>                             <asp:Button ID="button1" runat="server" Text='<%# Eval("ItemsID") %>' />                         </ItemTemplate>                     </asp:Dat

    Routing, Paging and Area problem. Please, anyone?

    Hello,On a pager I use on my MVC site I create the page links as follows: private String GetPageLink(Int32 number, String text) { RouteValueDictionary link = new RouteValueDictionary(_values); link.Add("page", number); VirtualPathData path = RouteTable.Routes.GetVirtualPath(_context.RequestContext, link); return path == null ? null : String.Format("<a href=\"{0}\">{1}</a>", path.VirtualPath, text); } // GetPageLink On a MVC 2 web site I have an area named CMS.For example, on "cms/article/list" the pager works fine.However, on my root views, for example in "article/index" the page 1 link become:  http://localhost:7422/cms/article?page=9It should be just:  http://localhost:7422/article?page=9o On my Global.Asax I have the following:  routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new String[] { "PrjMvc.Presentation.Controllers" }); routes.MapRoute("CMS_Area", "{area}/{controller}/{action}/{id}", new { area = "CMS", controller = "Home", action = "Index", id = UrlParameter.Optional });Any idea how to fix this?I have been going around with this and I can't find a

    How can I get Result Search with Paging in DataList Control

     I have Database called mygroup , and I have three tables *  Cataloges table .. columns (CatalogeId  int,   CatalogeName nvarchar) *  Brand table  .. columns (BrandId  int,   BrandName nvarchar) *  Products table, it is consists of these columns : ProductId   int ProductNO  nvarchar CatalogeId  int BrandId   int MainSpecification  nvarchar DetailsSpecification  ntext Image  imageand I want to desgin form for products, and this form contain these ToolBox *   DropDownList  for CatalogeId *   DropDownList for BrandId *   DataList Control for displaying the Result Search *  Button   When the user visit Product Page for Example (productpage.aspx),  then he see the two DropDownList , then choose one of Cataloge Name (Laptop , Printer, ....) , and choose one of the Brand Name (Sony, Toshiba, ....) , then Click the Button, and get the  Result Search in Paging DataList 

    Problem with gridview paging

    HI I have problem in Gridview paging, i am using pagersettings.firstpageimageurl to set the image, if i do like this the page will call twice all its event, and if i remove this image, the page will work correctly. if anybuddy know why its so, please replay <   pagersettings mode="NextPreviousFirstLast"   firstpageimageurl="Images/nav_first.gif"   firstpagetext="First Page"   lastpageimageurl="Images/nav_last.gif"   lastpagetext="Last Page"   nextpageimageurl="Images/nav_next.gif"   nextpagetext="Next Page"   previouspageimageurl="Images/nav_previous.gif"   previouspagetext="Previous Page"   position="Bottom"/>

    Gridview paging problem

    i am facing a problem of gridview paging. In Datalist, i am showing thumbnail images . After click thumnail, images will come up in ajax modalpopup in gridview. If i click on first thumbnail and images will come up in gridview if i close the popup while seeing second image in gridview and click on other thumbnail then images will come up but 2 image is showing instead of 1. because i ahve closed my previous popup while seeing 2 image. if i close the modal popup while seeing 3rd images, next time aftr binding it is showing 3rd images instead of start with 1st.   Datalist showing thumbnail                                                                                                                                                                           <asp:DataList ID="DatalistProducts" RepeatDirection="Horizontal" RepeatColumns="3"   runat="server" OnItemCommand="DatalistProducts_I

    Datalist with paging and filtering


    hi my i'm gio. i have made site with datalist and i want to use SQL data  filteting and paging,my only problem is that i want to put filtering into paging procedure  

    paging 1)

    ALTER PROCEDURE dbo.GetProductsPaged
    @startRowIndex int,
    @maximumRows int
    SELECT     ID, Category, Type, Unit, MainImg, Price, Sale, Statu

    problem with datalist in updatepanel


    Hi! i try to make a search part. there is a textbox which will be used for search context. also, i need to list category names. i don't use dropdownlist because its styles(for example border-style)doesn't change. So i tyr to do like this:i use a label and datalist. when clicking the label, datalist is showing. when i click the category name on datalist, it will be shown on label.(label is not in datalist.)my problem starts at that point. when i click category name on datalist , page is being postback. so i put datalist into updatepanel. but this time , i click category name on datlist,nothing occurs.(category name doesn't shown on label).my code is below:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    Datalist paging


    How to enable paging in Asp.net Datalist control

    Problem with Paging Back



    I have a .Net application that sits within an iframe of another application, and the .Net application is executed via a query string. What I would like to know is whether I can access a Session variable using JavaScript that I will set in my .Net application from the outside application? The other problem is that the .Net application sits in one domain and the other application sits in another domain (i.e. they are on different servers)

    Star rating in Datalist problem


    I have a user comments area that people can add their comments to the page.  I have successfully gotten the star rating to save into the database.  I now want to display the star rating into a datalist.

    Here is what I have so far:

    <asp:DataList ID="DataList1" runat="server" CellPadding="3"
                    DataSourceID="dsHotelComments" Visible="False" BackColor="White"
            BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
        GridLines="Horizontal" Width="843px">
                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                    <AlternatingItemStyle BackColor="#F7F7F7" />
                    <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <SelectedItemStyle BackCo

    hi problem with grid paging when grid is placed in ajax model popup extender


    hi i had one ajax tab containeer.in that i placed a grid on click of the grid i am showing another grid which has pagination in a popup. the popup grid has the pagination(custom) which iam showing prev and next button in middle drop downlist the code is as fllows


    <asp:ImageButton ID="imgbtnOPrev" runat="server" CommandArgument="prev" CommandName="Page"

     ImageUrl="~/Images/prev.gif" OnCommand="imgbtnOPre

    Problem filling labels with table data outside datalist using single call to db


    On a single page, I'd like to fill 2 hyperlink controls as well as a datalist control with table data using one call to the database. The page looks like this:

    <div id="PageContent">    
          Please select the district you wish to view below.</p>
          <asp:DropDownList ID="ddlDistrict" runat="server" CssClass="textbox" 
            DataTextField="DistrictName" DataValueField="DistrictId" AutoPostBack="True" 
        <p><asp:label ID="lblDistrictAbbrev" runat="server" Text="District Abbreviation: " />
          <asp:hyperlink ID="hyperlinkDistrictName" runat="server" 
            Text='' NavigateUrl="~/Contact/NationalCouncil.aspx" 
            Font-Bold="True" />
        <p><asp:label ID="lblDistrictCouncillor" runat="server" Text="District Councillor: " />
          <asp:hyperlink ID="hyperlinkCouncillor" runat="server" 
            Text='' NavigateUrl="~/Contact/NationalCouncil.a

    Datalist paging Dynamically........


    Hi all. Actually am given a  urgent task of implementing paging using Asp.net Datalist

    I did that by using "PagedDataSource" Class..by placing two buttons         

    "prev Page" &"Next Page" ..it reallty worked..But am asked to do that by placing  links

    1 ,2 ,3(pages)dynamically ...In this case database is not used ...the data api is already


    All i wanted to do is that to implement paging by using 1, 2 ,3 links and it should adjust accordingly to the number of records in the datalist....

    Thanks in Advance..


    Am a beginner ...kindly help me....

    Custom paging sorting stored procedure problem



    I want to make my gridview enable for custom paging and sorting. I started to follow a tutorial and write the Stored procedure.

    But my stored procedure seems not to be working. here it is:

    ALTER PROCEDURE [dbo].[USP_getStudentsEmail]
        @sortExpression nvarchar(100),
        @startRowIndex int,
        @maximumRows int,
        @receiver nvarchar(38)
    IF LEN(@sortExpression) = 0
        SET @sortExpression = 'SendDate'
    DECLARE @sql nvarchar(4000)
    SET @sql = 'Select *
    	Select m.Body,m.Subject,m.SendDate,m.SenderProfile,m.Receiver AS Receiver,m.ID,s.FirstName,ROW_NUMBER() OVER (ORDER BY '+ @sortExpression + ') AS RowRank 
    	from Message m INNER JOIN StudentProfile s ON m.Sender=s.UserId
    ) AS OrderedEmails
                WHERE     m.Receiver= '+ CONVERT(nvarchar(38), @receiver) + 'AND RowRank > ' + CONVERT(nvarchar(10), @startRowIndex) +
                    ' AND RowRank <= (' + CONVERT(nvarchar(10), @startRowIndex) + ' + '
                    + CONVERT(nvarchar(10), @maximumRows) +')'
    EXEC sp_executesql @sql

    I tried to run this by the following line

    exec USP_getStudentsEmail 'SendDate',1,1,'5ed19f91-eeb7-4c6a-b564-98c8dd83e18c'

    but it says  

    Incorrect syntax near 'd19f91'-

    can anybody help

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend