Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen menu visibility is turned off I can't see another pages content
    text
    copied!<p>I have a master page with the following code:</p> <pre><code>&lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;!-- BEGIN: Sticky Header --&gt; &lt;div id="header_container"&gt; &lt;div id="header"&gt; &lt;div id="headerBar"&gt; &lt;a href="&lt;% = Page.ResolveUrl("~/default.aspx") %&gt;"&gt; &lt;img src="&lt;% = Page.ResolveUrl("~/images/logo.png") %&gt;" id="logo" /&gt;&lt;/a&gt; &lt;span id="header_text"&gt; Scrum Reports&lt;/span&gt; &lt;asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="login_status" LogoutAction="Redirect" LogoutPageUrl="~/default.aspx" /&gt; &lt;asp:LoginName ID="LoginName1" runat="server" CssClass="login_user" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="menuBar"&gt; &lt;asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" StaticDisplayLevels="2" Orientation="Horizontal" &gt; &lt;/asp:Menu&gt; &lt;asp:SiteMapDataSource ID="SiteMapDataSource1" SiteMapProvider="admin" runat="server" /&gt; &lt;asp:SiteMapDataSource ID="SiteMapDataSource2" SiteMapProvider="user" runat="server" /&gt; &lt;/div&gt; &lt;!-- END: Sticky Header --&gt; &lt;!-- BEGIN: Page Content --&gt; &lt;div id="mainContent"&gt; &lt;div id="container"&gt; &lt;div id="content"&gt; &lt;asp:ContentPlaceHolder ID="Main" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- END: Page Content --&gt; &lt;!-- BEGIN: Sticky Footer --&gt; &lt;div id="footer_container"&gt; &lt;div id="footer"&gt; Developed by Application Solutions &lt;/div&gt; &lt;/div&gt; &lt;!-- END: Sticky Footer --&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>Now I am using the following C# (as part of the master pages <code>Page_Load</code> method)to show or hide the sites menu depending on whether a user is logged in:</p> <pre><code>Menu1.Visible = Page.User.Identity.IsAuthenticated; </code></pre> <p>For some reason, this line of code is preventing content from being seen on another page when the user isn't logged in.</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/master/template.master" CodeFile="recoverpassword.aspx.cs" Inherits="password_recoverpassword" %&gt; &lt;asp:Content ID="Content1" Visible="true" ContentPlaceHolderID="Main" runat="Server"&gt; &lt;div&gt; Cant see this content when not logged in. &lt;/div&gt; &lt;/asp:Content&gt; </code></pre> <p>Why is this happening? What can I do about it? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload