Click here to Skip to main content
15,910,787 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to implement paging in asp.net website like a google and i used repeater for display content on webpage the content are displaying but the paging repeater not working when i clicked on linked button they're not working and if i'm not using master page then everything works good but i add master page link button not worked

if someone has any relevant solution please help me i'm stucked now
thanks with or without help...
ASP.NET
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Finalpation.aspx.cs" Inherits="Finalpation" %>

ASP.NET
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">



ASP.NET
 <li><asp:LinkButton ID="lnkFirst" runat="server"  OnClick="lnkFirst_Click"> << First</asp:LinkButton></li>
                                    <li class="active"><asp:LinkButton ID="lnkPrevious" runat="server" OnClick="lnkPrevious_Click"> < Previous </asp:LinkButton> </li>
                                    <li><asp:Repeater ID="repeaterpaging" runat="server"  onitemcommand="repeaterpaging_ItemCommand" OnItemDataBound="repeaterpaging_ItemDataBound">
 <ItemTemplate>
   <asp:LinkButton ID="btnPage"  CommandName="Page" CommandArgument='<%# Eval("PageIndex") %>' Text='<%# Eval("PageText") %> ' runat="server" Font-Bold="True">
  </asp:LinkButton>                           
 </ItemTemplate>
 </asp:Repeater> </li>
 <li></li>
                                    <li><asp:LinkButton ID="lnkNext" runat="server" OnClick="lnkNext_Click">Next > </asp:LinkButton></li>
                                   
                                    <li><asp:LinkButton ID="lnkLast" runat="server"  OnClick="lnkLast_Click">Last >> </asp:LinkButton>
</li>



C#
protected void lnkNext_Click(object sender, EventArgs e)
    {
        lnkNext.Attributes["style"] = "background-color:black;color:#fff";
        lnkFirst.Attributes["style"] = "";
        lnkPrevious.Attributes["style"] = "";
        lnkLast.Attributes["style"] = "";
        if (Pageno == totalPages)
        {
            Pageno = totalPages;
        }
        else
        {
            Pageno = Pageno + 1;
        }
        BindRepeater();
    }


What I have tried:

(1) i used causes validation inside linked button
(2) and enableview state
Posted
Updated 8-Sep-16 21:49pm
v4
Comments
njammy 25-Aug-16 5:15am    
Debug13, Please click "Improve Question" and include your markup and code behind in your question.
rahulkumar013 25-Aug-16 5:22am    
okey sir i've updated my question can you plz check ...i have to implement paging in website everything works fine if i'm not adding master page but if i'm using master page i dont understand where i'm wrong
njammy 25-Aug-16 5:43am    
...It will be good for you to also include your Masterpage declaration in your question too.
rahulkumar013 25-Aug-16 6:03am    
i think i already include master page declarations look above
njammy 25-Aug-16 6:13am    
No there is not, I mean the <%@ Page declaration with masterpage attribute.
Also, what is the exact error you are seeing?

1 solution

Try using hidden field to hold the current index of the recordset.
please have a look ASP.NET Repeater Paging[^]
 
Share this answer
 
Comments
rahulkumar013 27-Sep-16 13:14pm    
is it possible to use query string with onitemcommand="repeaterpaging_ItemCommand" and OnItemDataBound="repeaterpaging_ItemDataBound" when i click on it i will get pageindex value as query string

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900