如果我将 BulletedList Web 控件设置为具有 displaymode="hyperlink",有没有办法以编程方式访问服务器端的超链接?我能得到的最接近它的是父 li 标签,但这不是我需要的。我需要为链接应用一个 css 类,如果我在客户端执行它,我会看到应用类之前和应用之后之间的微小闪烁。
想法?
更新:
<asp:BulletedList ID="List1" runat="server" DisplayMode="HyperLink">
<asp:ListItem Value="http://www.google.com">Go to Google</asp:ListItem>
</asp:BulletedList>
List1.Items[0].Attributes.Add("class", "some_basic_class"); //this applies to the <li> tag