The render-mode attribute selects how a Razor Component produces and delivers content when embedded in a controller view or Razor Page. section 33.3.2
Choose among three rendering behaviors:
- Static renders the component as HTML without client-side support. section 33.3.2
- Server sends a placeholder first, then delivers the component’s HTML over a persistent HTTP connection. section 33.3.2
- ServerPrerendered sends initial static HTML immediately, then replaces it with dynamic content after the connection is established. section 33.3.2
Embedding PeopleList
A controller view selects server rendering with <component type="typeof(Advanced.Blazor.PeopleList)" render-mode="Server" />. Requesting /controllers lets the component respond to the select element without a form submission. section 33.3.2
Table 33.3 The RenderMode values (view table figure)
| Name |
Description |
|---|---|
| Static |
The Razor Component renders its view section as static HTML with no client-side support. |
| Server |
The HTML document is sent to the browser with a placeholder for the component. The HTML displayed by the component is sent to the browser over the persistent HTTP connection and displayed to the user. |
| ServerPrerendered |
The view section of the component is included in the HTML and displayed to the user immediately. The HTML content is sent again over the persistent HTTP connection. |
Compare the Static, Server, and ServerPrerendered behaviors and their HTML delivery sequences. section 33.3.2
