• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1230
  • Last Modified:

DataPager - hide previous button (image type) when needed

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

1 Solution
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.
centdevsAuthor Commented:
Wonderful that worked, thank you!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now