changing the forecolor of a hyperlink of a datagrid
Posted on 2004-10-08
I have created a hyperlink using a template column on a datagrid ...
<asp:Hyperlink runat="server" Text='View Details' ForeColor="Purple" NavigateUrl='<%# "page.aspx?ViewID=" & Server.UrlEncode(Container.DataItem("datafield"))%>' ID="Hyperlink1"/>
Now..everything works fine..when i click on the hyperlink, it takes me to a new page..
what i want to do is when the user moves his mouse over the hyperlink, the forecolor of the hyperlink should change...i tried the following but it didnt work..
'If e.Item.ItemType = ListItemType.AlternatingItem Then
i tried this.style.ForeColor also..it didnt work..what i found out was, this was overridden by the forecolor attritbute that was set while displaying the hyperlink itself...
if so how would i implement the following??