Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to change font in a repeater control

    I am using a repeater control and in that I have set the font through a stylesheet. But I want to change the color of the font if the user is in specific page.

    For example I have links like Home Products Categories
    These text are white in color (blue background table)

    If the user clicks on the Products, then the products should show in yellow. How can I do it with a repeater control? I am using a style sheet.

    Here is the code:

    Code:
    <ItemTemplate>
               <td align="left">
               <asp:HyperLink ID="HyperLink1" CssClass="nav_bar_text"   NavigateUrl='<%#DataBinder.Eval(Container.DataItem, "url_link")%>' Text='<%#DataBinder.Eval(Container.DataItem, "text")%>'  runat="server" />
                        </td>
                </ItemTemplate>

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Add a class and add logic in the backend that changes the value?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    This is a job for your code behind page.
    In the page load, you'd check the page name, and change the attribute of elements as appropriate.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •