Hi,.
i try to change the color of the main menu when the visitor of the site is
logged.
When not logged, it must be red, when logged, it must be green.
I start in the Master¨Page with putting the link to the red CSS file to
Visible and to the green CSS file to False..
In code-behind, i test if the loginview has changed: if yes, i change
Visible to False and inverse .
But it always remains red!
See my code:
Thanks for help
Bjorn
aspx file:
-------
<head runat="server">
<link id="lk1" href="Corered.css" rel="stylesheet" type="text/css"
visible="true" />
<link id="lk2" href="Coregreen.css" rel="stylesheet" type="text/css"
visible="false" />
</head>
<body>
<form id="form1" runat="server">
<div id="Menu"<mai:Mainmenu ID="MMenu1" runat="server" /</div>
<div id="Content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder</div>
</div>
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
</AnonymousTemplate>
<LoggedInTemplate>
</LoggedInTemplate>
</asp:LoginView>
code-behind:
-------------
Protected Sub LoginView1_ViewChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LoginView1.ViewChanged
If lk1.Visible = "true" Then
lk1.Visible = "false"
lk2.Visible = "true"
Else
lk2.Visible = "false"
lk1.Visible = "true"
End If
End Sub 3 1180
unless you put a runat=server on the links, the visible tag is
meaningless for a link
-- bruce (sqlwork.com)
Bjorn wrote:
Hi,.
i try to change the color of the main menu when the visitor of the site is
logged.
When not logged, it must be red, when logged, it must be green.
I start in the Master¨Page with putting the link to the red CSS file to
Visible and to the green CSS file to False..
In code-behind, i test if the loginview has changed: if yes, i change
Visible to False and inverse .
But it always remains red!
See my code:
Thanks for help
Bjorn
aspx file:
-------
<head runat="server">
<link id="lk1" href="Corered.css" rel="stylesheet" type="text/css"
visible="true" />
<link id="lk2" href="Coregreen.css" rel="stylesheet" type="text/css"
visible="false" />
</head>
<body>
<form id="form1" runat="server">
<div id="Menu"<mai:Mainmenu ID="MMenu1" runat="server" /</div>
<div id="Content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder</div>
</div>
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
</AnonymousTemplate>
<LoggedInTemplate>
</LoggedInTemplate>
</asp:LoginView>
code-behind:
-------------
Protected Sub LoginView1_ViewChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LoginView1.ViewChanged
If lk1.Visible = "true" Then
lk1.Visible = "false"
lk2.Visible = "true"
Else
lk2.Visible = "false"
lk1.Visible = "true"
End If
End Sub
Thanks for replying...
I added on both link runat="server" like you suggested:
<link id="lk1" href="Corered.css" rel="stylesheet" type="text/css
runat="server" visible="true" />
but it still doesn't work.
Wthout that runat="server", if the visible tag would be then meaningless,
then it would be green, not red, because the green-link comes after the
red-link. Am i wrong?
I thing the problem is elsewhere, but where ...
"bruce barker" <no****@nospam.comschreef in bericht
news:Om**************@TK2MSFTNGP03.phx.gbl...
unless you put a runat=server on the links, the visible tag is meaningless
for a link
-- bruce (sqlwork.com)
Bjorn wrote:
>Hi,.
i try to change the color of the main menu when the visitor of the site is logged. When not logged, it must be red, when logged, it must be green. I start in the Master¨Page with putting the link to the red CSS file to Visible and to the green CSS file to False.. In code-behind, i test if the loginview has changed: if yes, i change Visible to False and inverse . But it always remains red! See my code:
Thanks for help Bjorn
aspx file: ------- <head runat="server"> <link id="lk1" href="Corered.css" rel="stylesheet" type="text/css" visible="true" /> <link id="lk2" href="Coregreen.css" rel="stylesheet" type="text/css" visible="false" /> </head> <body> <form id="form1" runat="server"> <div id="Menu"<mai:Mainmenu ID="MMenu1" runat="server" /> </div> <div id="Content"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder</div> </div> <asp:LoginView ID="LoginView1" runat="server"> <AnonymousTemplate> </AnonymousTemplate> <LoggedInTemplate> </LoggedInTemplate> </asp:LoginView>
code-behind: ------------- Protected Sub LoginView1_ViewChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginView1.ViewChanged If lk1.Visible = "true" Then lk1.Visible = "false" lk2.Visible = "true" Else lk2.Visible = "false" lk1.Visible = "true" End If End Sub
On Feb 28, 1:16 pm, "Bjorn" <b...@nospam.ukwrote:
Thanks for replying...
I added on both link runat="server" like you suggested:
<link id="lk1" href="Corered.css" rel="stylesheet" type="text/css
runat="server" visible="true" />
but it still doesn't work.
Wthout that runat="server", if the visible tag would be then meaningless,
then it would be green, not red, because the green-link comes after the
red-link. Am i wrong?
I thing the problem is elsewhere, but where ...
"bruce barker" <nos...@nospam.comschreef in berichtnews:Om**************@TK2MSFTNGP03.phx.gbl. ..
unless you put a runat=server on the links, the visible tag is meaningless
for a link
-- bruce (sqlwork.com)
Bjorn wrote:
Hi,.
i try to change the color of the main menu when the visitor of the site
is logged.
When not logged, it must be red, when logged, it must be green.
I start in the Master¨Page with putting the link to the red CSS fileto
Visible and to the green CSS file to False..
In code-behind, i test if the loginview has changed: if yes, i change
Visible to False and inverse .
But it always remains red!
See my code:
Thanks for help
Bjorn
aspx file:
-------
<head runat="server">
<link id="lk1" href="Corered.css" rel="stylesheet" type="text/css"
visible="true" />
<link id="lk2" href="Coregreen.css" rel="stylesheet" type="text/css"
visible="false" />
</head>
<body>
<form id="form1" runat="server">
<div id="Menu"<mai:Mainmenu ID="MMenu1" runat="server"/>
</div>
<div id="Content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder</div>
</div>
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
</AnonymousTemplate>
<LoggedInTemplate>
</LoggedInTemplate>
</asp:LoginView>
code-behind:
-------------
Protected Sub LoginView1_ViewChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LoginView1.ViewChanged
If lk1.Visible = "true" Then
lk1.Visible = "false"
lk2.Visible = "true"
Else
lk2.Visible = "false"
lk1.Visible = "true"
End If
End Sub
Try putting your .css in the App_Themes folder of your application and
then in the Page_Load, set the Page.Theme to the appropriate value.
I'm not certain this will work, but was recently reading the docs on
the Page.Theme property.
Chris This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: sdm |
last post by:
Hi
I am in the process of moving my website from NT4/IIS4 to Windows 2003. Both
server are set to a short date format of (dd/mm/yy) however the Windows 2003
server appears to be ignoring this...
|
by: Deacon |
last post by:
Dear all,
I am using DB2 for AIX, I have the following problem when migrating my DB
from DB2 v7.2 to v8.1
I orginally have a table with a CLOB field with logged and not compact
properties. We...
|
by: Steven Fox |
last post by:
============================================================
About DB2 Administration Tools Environment
============================================================
DB2 administration tools level:...
|
by: James Griffiths |
last post by:
Here is a report I've written about a printing problem that is being
experienced by a particular company for whom I had developed a A97 system.
After upgrading to Win XP and AXP, some printing...
|
by: Alexandra |
last post by:
Hi,
I have a hidden system file that I need to read.
I am logged in as an administrator.
I can not change the file attributes using the windows explorer.
|
by: |
last post by:
Hi,
I'm trying to use the cookie munging session handling behaviour of asp.net
instead of cookies themselves as I'm finding quite a few people are barring
cookies (especially AOL users). If I...
|
by: - Steve - |
last post by:
I'm trying to change a user's password using objUser.Invoke("setPassword",
"newpassword")
It works fine as a console application if I'm logged in with someone with
the correct permissions. If...
|
by: Kevin D. |
last post by:
Please note, I already posted this on the MySQL official forum, but received
no response. I thought I'd try again in another location. My apologies to
anyone reading this twice...
Despite...
|
by: Bjorn |
last post by:
Hi,.
i try to change the color of the main menu when the visitor of the site is
logged.
When not logged, it must be red, when logged, it must be green.
I start in the Master¨Page with putting...
|
by: Jonno |
last post by:
Hi
I am having a problem with session vars being propagated between pages
on this site:
http://www.meettheancestors.com/sessiontest/index.php
If you enter any user id and password and click Log...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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: 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: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |