I have added the CSS below into my style sheet.
I am using the HTML/ASP.Net below to set the class of the hyperlink control.Code:a.inactivelink:hover{color:red; text-decoration:none} a.activelink:hover{color:green; text-decoration:underline} a.inactivelink:link{color:red; text-decoration:none} a.activelink:link{color:green; text-decoration:none}
When I run the script the CSS is not been picked up at all by the hyperlink regardless of the conditional statement. I forllow the W3C tutorial but somehow must be referencing by hyperlink wrong?
HTML Code:<div id="course-listing-container" class="course-listing-container"> <asp:Repeater ID="EventsResultsRepeater" runat="server" OnItemCommand="EventsResultsRepeater_ItemCommand"> <HeaderTemplate> <table class="coursetable1" border="0" cellpadding="0" cellspacing="0"> <tr> <th class="leftcol" scope="col">Event Code</th> <th>Start</th> <th>End</th> <th class="leftcol" scope="col">Location</th> <th>Options</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td class="leftcol"><asp:Label ID="lblGspEventID" runat="server" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem, "GspEventID")%>'></asp:Label><%# DataBinder.Eval(Container.DataItem, "EventID")%></td> <td><%# DataBinder.Eval(Container.DataItem, "StartDate","{0:dd-MMM-yy}")%> </td> <td><%# DataBinder.Eval(Container.DataItem, "EndDate", "{0:dd-MMM-yy}")%></td> <td class="leftcol"> <asp:HyperLink ID="locationlink" runat="server" NavigateUrl='<%# (DataBinder.Eval(Container.DataItem, "URL").ToString())%>' CssClass='<%# (DataBinder.Eval(Container.DataItem, "URL").ToString()) == "fish" ? "inactivelink" : "activelink" %>' Enabled='<%# (DataBinder.Eval(Container.DataItem, "URL").ToString()) != "fish" %>'> <%# DataBinder.Eval(Container.DataItem, "LocationName")%></asp:HyperLink> <td> <asp:ImageButton ID="imgBtnViewEvent" runat="server" onclick="Event_Click" AlternateText="View" ImageUrl="~/images/view_doc.png" ToolTip="View Event" /> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr class="altrow"> <td class="leftcol"><asp:Label ID="lblGspEventID" runat="server" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem, "GspEventID")%>'></asp:Label><%# DataBinder.Eval(Container.DataItem, "EventID")%></td> <td><%# DataBinder.Eval(Container.DataItem, "StartDate","{0:dd-MMM-yy}")%> </td> <td><%# DataBinder.Eval(Container.DataItem, "StartDate","{0:dd-MMM-yy}")%> </td> <td class="leftcol"> <asp:HyperLink ID="locationlink" runat="server" NavigateUrl='<%# (DataBinder.Eval(Container.DataItem, "URL").ToString())%>' CssClass='<%# (DataBinder.Eval(Container.DataItem, "URL").ToString()) == "fish" ? "inactivelink" : "activelink" %>' Enabled='<%# (DataBinder.Eval(Container.DataItem, "URL").ToString()) != "fish" %>'> <%# DataBinder.Eval(Container.DataItem, "LocationName")%></asp:HyperLink> </td> <td> <asp:ImageButton ID="imgBtnViewEvent" runat="server" onclick="Event_Click" AlternateText="View" ImageUrl="~/images/view_doc.png" ToolTip="View Event" /> </td> </tr> </AlternatingItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> <asp:Button ID="btn_Submit" runat="server" Text="Click to Popup" style="display:none;"/>





Reply With Quote