title: Blazor - Using Cascading Authentication State Between Different Layouts
body: <p>I have a .NET Core 3.1 Blazor project where there will be 3 sub-folders within the application that serve up a single page each whose content will be WebGL driven using Three.JS.</p>
  
  <p>In the first folder I am testing with, I have created two items. The first is named "_TestPage.cshtml" and the other is named "Index.razor". Both pages have the following @page directive in them:</p>
  
  <pre><code>@page "/Applications/TestFolder1/Index"
  </code></pre>
  
  <p>The _TestPage.cshtml page contains the following within it:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;body&gt;
          &lt;app&gt;
              &lt;component type="typeof(App)" render-mode="Server" /&gt;
          &lt;/app&gt;
      &lt;/body&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
  
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  
          &lt;title&gt;My Blazor App&lt;/title&gt;
  
          &lt;base href="/" /&gt;
  
          &lt;script src="_framework/blazor.server.js"&gt;&lt;/script&gt;
          &lt;style type="text/css"&gt;
              body {
                  background-color: red;
              }
          &lt;/style&gt;
      &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The Index.razor page also has the following within it:</p>
  
  <pre><code>@layout EmptyLayout
  @page "/Applications/Monitor/Index"
  
  &lt;AuthorizeView&gt;
      &lt;Authorized&gt;
          &lt;p style="color: black;"&gt;***I can not see this text either...***&lt;/p&gt;
      &lt;/Authorized&gt;
      &lt;NotAuthorized&gt;
          &lt;RedirectNotAuthorizedAccess /&gt;
      &lt;/NotAuthorized&gt;
  &lt;/AuthorizeView&gt;
  </code></pre>
  
  <p>However, when the app starts up, I am able to go directly to the Index page in the sub-folder without having to log in. I get a solid red background but do not see any rendered text nor do I get redirected to the login page as it should since I have not logged in.</p>
  
  <p>Is there something different I need to be doing to have Cascading Authentication State work when I'm not using the default "MainLayout" component creating by Visual Studio and have over-written the layout inside a razor page using the @layout directive?</p>