We help IT Professionals succeed at work.

DataPager - hide previous button (image type) when needed

centdevs asked
Medium Priority
Last Modified: 2012-05-06
I am using a data pager with next previous pager fields (as images).  When the previous button is not a valid option, I would like it to be more visibly apparent.  For example, swapping out the image for a "grayed out" version, or simply just hiding the previous button.  How can I accomplish this?
<asp:DataPager ID="pgProducts" runat="server" PagedControlID="lvProducts" PageSize="3">
                            <asp:NextPreviousPagerField ButtonType="Image"  
                                PreviousPageImageUrl="/images/back.gif" />

Open in new window

Watch Question

There is a property on the NextPreviousPagerField called RenderDisabledButtonsAsLabels, you can set that to true.  You could then use CSS to modify the label as necessary.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Wonderful that worked, thank you!!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.