In ASP.NET 3.0 Core Blazor, using HTML help program (HTML. RenderComponentAsync) component to the page and view. In ASP.NET Core 3.1, use a new component tag helper to render components from a page or view: CSHTMLdownload:.NET Core development practice

Copying HTML helpers is still supported in ASP.NET Core 3.1, but component markup helpers are recommended. Blazor Server applications can now pass parameters to top-level components during initial rendering. Previously, you could only pass parameters to top-level components that had rendermode.static. In this version, the RenderMode. Server and RenderMode ServerPrerendered are supported. Any specified parameter values are serialized to JSON and included in the initial response. For example, a Counter component is prerendered with IncrementAmount: CSHTML

For more information about copying, see Integrating Components into Razor Pages and MVC applications. Support for shared queues in http. sys Supports creating anonymous request queues. In ASP.NET Core 3.1, we added the ability to create http. sys request queues or attach to existing http. sys request queues. The http. sys controller process that owns the queue is independent of the listener process by creating or attaching a request queue named http.sys to an existing http.sys request queue. This independence allows existing connections and queued requests to be retained during listener process restart: C#

Copy the public static IHostBuilder CreateHostBuilder (string [] args) = > Host. CreateDefaultBuilder (args) .ConfigureWebHostDefaults(webBuilder => { // … webBuilder.UseHttpSys(options => { options.RequestQueueName = “MyExistingQueue”; options.RequestQueueMode = RequestQueueMode.CreateOrAttach; }); }); Disruptive changes to the SameSite cookie The behavior of the SameSite cookie has changed to reflect upcoming browser changes. This can affect authentication scenarios such as AzureAd, OpenIdConnect, or WsFederation. For more information, see SameSite in Using Cookies ASP.NET Core. Prevent EVENT default action in Blazor application use @ON {EVENT}:preventDefault directive property to prevent EVENT default action. In this example, the default action that prevents the display of key characters in a text box: Razor

Copy the < input value = “@ _count” @ onkeypress = “KeyHandler” @ onkeypress: the preventDefault / > for more information, please refer to prevent the default action. Stop EVENT propagation in Blazor applications Use the @ON {EVENT}:stopPropagation directive attribute to stop EVENT propagation. In this example, check the box to block children

The click event is propagated to the parent

: razor

< inpu@bind =”_stopPropagation” type=”checkbox” />

.

@code { private bool _stopPropagation = false; } For more information, see Stopping Event propagation.