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

  • SEARCH
  • Home
  • 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 7050547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:09:25+00:00 2026-05-28T03:09:25+00:00

I have the following PagerTemplate. I need to hide the Previous link when user

  • 0

I have the following PagerTemplate. I need to hide the Previous link when user is viewing the first page and hide the Next link if user is viewing the Last page.

                <PagerTemplate>
                    <table border="0" style="width: 100%;">
                        <tbody>
                            <tr>
                                <td style="float: right;">
                                    <asp:LinkButton CommandName="Page" CommandArgument="Prev" ID="LinkButton2" runat="server"><< Previous</asp:LinkButton>
                                    &nbsp;<asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server" >Next >></asp:LinkButton>
                                </td>
                                <td style="clear: both"></td>
                            </tr>
                        </tbody>
                    </table>
                </PagerTemplate>
  • 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-28T03:09:25+00:00Added an answer on May 28, 2026 at 3:09 am

    Grid’s PageIndex and PageCount properties will help you here – Prev link should be shown/enabled only when PageIndex > 0 while Next link should be shown/enabled only when PageIndex < PageCount - 1.

    Use row created event to find controls and alter the visibility. For example,

    protected void GridView_RowCreated(Object sender, GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.Pager)
        {
           var prev = (LinkButton)e.Row.FindControl("LinkButton2");
           prev.Visible = Grid.PageIndex > 0;
    
           var next = (LinkButton)e.Row.FindControl("LinkButton3");
           next.Visible = Grid.PageIndex < grid.PageCount -  1;
        }
    }
    

    I am not sure of you need a custom template for current UI. You can use pager settings – for example,

    <pagersettings mode="NextPrevious"
                nextpagetext="Next >>"
                previouspagetext="<< Previos"   
                position="Bottom"/> 
    

    And use PagerStyle for styling the UI.

    <PagerStyle CssClass="myPager" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following CSS: table tbody tr:last-child td { padding-top: 7px; border-bottom: 0; }
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following div in a page (I can not modify). <div id=:0.control>Click me</div>
I have following setup. from django.db import models from django.contrib.auth.models import User class Event(models.Model):
I have following data in text file 375020222511963 284970411563422 290245594366931 I need to retrieve
I have the following code in my user control: <asp:LinqDataSource ID=myLinqDataSource runat=server AutoSort=true ContextTypeName=MyDBContext
I have following html codes <div align=center style=width:1000px;border:1px solid green;> <div style=border:1px solid red;float:left;
I have following table it shows like this: ABC A B C 123 Hello
I have following simple HTML and JS code. When User selects Italian Language option
I have following HTML menu: <ul> <li><a href=index.html>Index Page</a></li> <li><a href=#some-page>Some Page</a></li> </ul> Let

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.