J
Jon Natwick
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
<asplaceHolder id="phLogout" runat="server"></asplaceHolder>
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
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
<asplaceHolder id="phLogout" runat="server"></asplaceHolder>
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