Board index » Web Programming » Dynamic Logout Link - with style?
|
Computerdude
|
Dynamic Logout Link - with style?
Web Programming79
I'm trying to add a dynamically created logout link on my pages. The link to the logout page will show if the user is logged in. I put a placeholder on the aspx page and then dynamically create the link, if the user is logged. So far, so good. It's working. Aspx <asp:PlaceHolder id="phLogout" runat="server"></asp:PlaceHolder> Cs System.Web.UI.HtmlControls.HtmlAnchor hLogout = new HtmlAnchor(); hLogout.ID = "hlLogout"; hLogout.HRef = "logout.aspx"; hLogout.InnerText = "Logout"; phLogout.Controls.Add (hLogout); But the trouble is, how can add a style to the Logout link? I have tried using this "Style" attribute without success. hLogout.Style.Add.??? = ??? As well as: hLogout.Attributes.CssStyle.??? = ??? Any ideas greatly appreciated. Jon - |
