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 2 3449
Hi Jon,
hLogout.Attributes["class"] = "myCSSclass";
hLogout.Style.Add("color","#123456");
hLogout.Style.Add("height","32px");
HTH,
Michel
"Jon Natwick" <no**********@yahoo.com> wrote in message news:<zy*****************@twister.rdc-kc.rr.com>... 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
Michel,
You are a genious!
Thank you,
Jon
"fd123456" <fd******@hotmail.com> wrote in message
news:c8*************************@posting.google.co m... Hi Jon,
hLogout.Attributes["class"] = "myCSSclass"; hLogout.Style.Add("color","#123456"); hLogout.Style.Add("height","32px");
HTH,
Michel
"Jon Natwick" <no**********@yahoo.com> wrote in message news:<zy*****************@twister.rdc-kc.rr.com>... 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: sujeevan |
last post by:
Hi,
i have created a web.
in the 1st page.
user can login.after login i start the session and save it in his
db-record.
also the page give a link to my important page.
in that page i check the...
|
by: paula |
last post by:
I've got a problem with asp.net i am trying to make a menu control. and have
searched the web for serveral controls but they don't work correctly.
I am pretty new to asp.net building. What am i...
|
by: JWL |
last post by:
Hi
I need to create a bunch of sites with slightly dynamic CSS. Basically,
all the image paths in the CSS need to be dynamic, depending on the
values of certain ASP variables.
I can think of...
|
by: nsvmani |
last post by:
Hi, i am trying to get the FileOpen dialogue window as soon as clicked href link
I am using IE6 with ActiveX enabled. Just need to get the File Open dialogue window when i click on the HREF links.It...
|
by: crescent_au |
last post by:
Hi all,
I've written a login/logout code. It does what it's supposed to do but
the problem is when I logout and press browser's back button (in
Firefox), I get to the last login page. In IE,...
|
by: shrik |
last post by:
hi everybody.
I have following problem.
There are two pages. index.jsp and main.jsp in my application
Index.jsp contains logging interface in .
It submits password and userid to loginform bean.
...
|
by: David W |
last post by:
I need to include a style sheet link in the aspx page based on what user
they are.
Basically this functionality, but using code behind. Any idea how to change
this line to code behind? This...
|
by: Frinavale |
last post by:
I've created a ASP.NET control that displays a "book" of schedules.
It dynamically displays scheduling times and allows the user to page through the schedules. It also lets the user edit the...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |