B
Bjorn
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
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