title: Blazor Components in Razor Pages
body: <p>We have a basic razor page app.  We would like to add Blazor components.  We have no problem getting this to work via replicating the steps in the 04/16 Blazor Update video or using the Blazor documentation.  However, once we add the Blazor component to a Razor page, all of our asp-page links no longer work.  The url changes in the address bar, but we remain on the same page.  The startup file is as follows:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.Configure&lt;CookiePolicyOptions&gt;(options =&gt;
      {
          options.CheckConsentNeeded = context =&gt; true;
      });
  
          services.AddRazorPages()
              .AddNewtonsoftJson();
  
          services.AddServerSideBlazor();
      }
  
      public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
          else
          {
              app.UseExceptionHandler("/Error");
              app.UseHsts();
          }
  
          app.UseHttpsRedirection();
          app.UseStaticFiles();
  
          app.UseCookiePolicy();
  
          app.UseRouting();
  
          app.UseAuthorization();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapRazorPages();
              endpoints.MapBlazorHub();
           });
      }
  </code></pre>
  
  <p>If some one can point me to a multi page tutorial with Razor Pages and Blazor Components, I’m sure we can figure this out! Thanks in advance!</p>
  
  <p>The blazor components works fine. </p>
  
  <pre><code>&lt;a asp-page="./Index"&gt;Home&lt;/a&gt;&lt;br /&gt; 
  &lt;div id="Counter"&gt; @(await Html.RenderComponentAsync&lt;Counter&gt;()) 
  &lt;script src="~/_framework/blazor.server.js"&gt;
  &lt;/script&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>The microsoft docs state - Integrate components into Razor Pages and MVC apps Use components with existing Razor Pages and MVC apps. There's no need to rewrite existing pages or views to use Razor components. When the page or view is rendered, components are prerendered† at the same time. - <a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/components?view=aspnetcore-3.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/blazor/components?view=aspnetcore-3.0</a></p>