View Full Version : How to change font in a repeater control

11-30-2006, 07:54 PM
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:

<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" />

12-01-2006, 07:39 PM
Add a class and add logic in the backend that changes the value?


12-01-2006, 08:19 PM
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.