RazorWireDialogCommand Command { get; }
Source
Gets whether the command opens or closes the pending dialog.
A Turbo Stream action that renders a partial view as its content.
Task<string> RenderAsync(ViewContext viewContext, CancellationToken cancellationToken = default)
Renders the configured partial view and wraps its output in a Turbo Stream element.
viewContext
cancellationToken
The turbo-stream HTML string containing the rendered partial inside a <template> element.
InvalidOperationException
Task<string> RenderPartialContentAsync(ViewContext viewContext, string viewName, object? model, CancellationToken cancellationToken = default)
Renders a partial view body without adding an outer Turbo Stream element.
viewContext
viewName
model
cancellationToken
The trusted Razor-rendered partial body.
InvalidOperationException
Internal helper for rendering view components into Turbo Stream fragments.
Task<string> RenderComponentStreamAsync(ViewContext viewContext, string action, string target, object componentIdentifier, object? arguments, CancellationToken cancellationToken = default)
Renders a view component into a Turbo Stream XML fragment.
viewContext
action
target
componentIdentifier
Type
or the component's string name.arguments
cancellationToken
A Turbo Stream XML fragment whose `action` and `target` attributes are HTML-encoded and whose <template> contains the rendered component HTML.
Task<string> RenderComponentContentAsync(ViewContext viewContext, object componentIdentifier, object? arguments, CancellationToken cancellationToken = default)
Renders a view component body without adding an outer Turbo Stream element.
viewContext
componentIdentifier
arguments
cancellationToken
The rendered component HTML.
A Turbo Stream action that renders a view component by its Type
.
Task<string> RenderAsync(ViewContext viewContext, CancellationToken cancellationToken = default)
Renders the configured view component into a Turbo Stream fragment.
viewContext
cancellationToken
A string containing a <turbo-stream> element whose action
and target
attributes are HTML-encoded and whose <template> contains the component's rendered HTML.
A Turbo Stream action that renders a view component by its name.
Task<string> RenderAsync(ViewContext viewContext, CancellationToken cancellationToken = default)
Render the configured view component (by name) into a Turbo Stream fragment.
viewContext
cancellationToken
A string containing a <turbo-stream> element whose action and target attributes are HTML-encoded and whose <template> contains the rendered component HTML.
Represents a RazorWire stream action that can render without view or component services.
RazorWireStreamBuilder.Build
uses this internal contract for stream actions whose markup is already fully known. Actions that need Razor view rendering should implement only IRazorWireStreamAction
so callers are directed to RazorWireStreamBuilder.RenderAsync(ViewContext, CancellationToken)
or RazorWireStreamBuilder.BuildResult(int?)
.
string Render()
Renders this action into a Turbo Stream fragment without using MVC rendering services.
The complete Turbo Stream fragment for the action.
Provides a mechanism to render Razor partial views to strings, specifically useful for background services and non-HTTP request contexts.
Task<string> RenderPartialToStringAsync(string viewName, object? model = null, CancellationToken cancellationToken = default)
Renders a partial view as an HTML string.
viewName
model
cancellationToken
A task that represents the asynchronous render operation. The task result contains the rendered HTML string.
An IActionResult
that renders and streams Turbo Stream actions to the response.
Task ExecuteResultAsync(ActionContext context)
Streams rendered Turbo Stream HTML for the configured actions to the HTTP response.
context
A dialog-containing result validates request correlation and sequentially renders the complete action snapshot before generating antiforgery tokens or setting response headers, so a later render failure cannot leave an earlier action partially applied. It then writes the buffered markup and echoes the validated request UUID in X-RazorWire-Request
. A correlated page-only result attaches metadata to package-authored target actions and echoes that request UUID while retaining the existing ordered streaming renderer. An uncorrelated page-only result remains compatible with callers that do not send RazorWire correlation headers.
ViewContext CreateViewContext(ActionContext actionContext)
Creates a ViewContext
configured for rendering the stream actions, optionally inheriting ViewData and TempData from the associated controller.
actionContext
A ViewContext configured with a NullView
, the prepared ViewData, TempData (the controller's if available or obtained from ITempDataDictionaryFactory), TextWriter.Null, and default HtmlHelperOptions.
Task<string> RenderAsync(ViewContext viewContext, CancellationToken cancellationToken = default)
Produces the stored raw HTML as the rendered output for the given view context.
viewContext
cancellationToken
The stored HTML string.
Task RenderAsync(ViewContext viewContext)
Performs no rendering and completes immediately.
viewContext
A completed Task
representing the finished render operation.
Describes the immutable body selection captured by one dialog command.
RazorWireDialogPayload ForMessage(string title, string? message)
Creates a validated plain-text dialog payload.
RazorWireDialogPayload ForPartial(string title, string viewName, object? model)
Creates a validated partial-view dialog payload.
RazorWireDialogPayload ForComponent(string title, Type componentType, object? arguments)
Creates a validated typed-component dialog payload.
RazorWireDialogPayload ForNamedComponent(string title, string componentName, object? arguments)
Creates a validated named-component dialog payload.
Renders the single normalized dialog command captured by a builder snapshot.
RazorWireDialogStreamAction Open(RazorWireDialogPayload payload)
Creates the final open command for the selected payload.
payload
The open command action.
RazorWireDialogStreamAction Close()
Task<string> RenderAsync(ViewContext viewContext, CancellationToken cancellationToken = default)
Rejects rendering without validated request metadata.
viewContext
cancellationToken
This method never returns markup.
Describes the validated request correlation values echoed on package-authored stream elements.
RazorWireRequestMetadata? Read(HttpRequest request, bool required)
Reads and validates correlation values from a request.
request
required
The validated metadata, or null
when no correlation headers were supplied and metadata is optional.
InvalidOperationException
string ToHtmlAttributes(RazorWireDialogPhase phase)
Creates encoded HTML attributes for a stream element using this request metadata and the action's position.
phase
A space-prefixed string of encoded data-rw-*
attributes.
Renders package-authored target actions with request correlation metadata.
Marks the single final dialog command in a builder snapshot.
RazorWireDialogCommand Command { get; }
Source
Gets whether the command opens or closes the pending dialog.
Provides shared action-position and rendering logic for builder and result paths.
int FindDialogCommandIndex(IReadOnlyList<IRazorWireStreamAction> actions)
Finds the final dialog command's position in a snapshot.
actions
The command index, or -1
when the response has no dialog command.
RazorWireDialogPhase GetPhase(int actionIndex, int dialogIndex, RazorWireDialogCommand? command)
Resolves the phase for a built-in target action from its position relative to the final command.
actionIndex
dialogIndex
-1
for page-only output.command
The phase serialized for the action.
Task<string> RenderActionAsync(IRazorWireStreamAction action, ViewContext viewContext, RazorWireRequestMetadata? metadata, RazorWireDialogPhase phase, CancellationToken cancellationToken)
Renders one action, adding metadata only for typed built-in target or dialog actions.
action
viewContext
metadata
null
for legacy uncorrelated output.phase
cancellationToken
The rendered stream markup.
Encodes and wraps built-in target actions with an optional, already validated correlation value.
string RenderTargeted(string action, string target, string? content, bool hasTemplate, RazorWireRequestMetadata? metadata = null, RazorWireDialogPhase phase = RazorWireDialogPhase.Origin)
Renders one package-authored targeted Turbo Stream element.
action
target
content
hasTemplate
metadata
null
for uncorrelated output.phase
The encoded Turbo Stream element.
A fluent builder for creating Turbo Stream responses.
RazorWireStreamBuilder Append(string target, string? content)
Queues an append action that inserts HTML-encoded text into the specified target element.
target
content
null
renders as empty text.
The same RazorWireStreamBuilder
instance to allow fluent chaining.
This method treats content
as plain text and HTML-encodes it before writing it to the stream template. Use AppendHtml(string,string?)
only when the caller already owns a trusted HTML fragment and has encoded any user-supplied values inside it.
RazorWireStreamBuilder AppendHtml(string target, string? trustedHtml)
Queues an append action that inserts a trusted HTML fragment into the specified target element without encoding or sanitizing it.
target
trustedHtml
null
renders as an empty fragment.
The same RazorWireStreamBuilder
instance to allow fluent chaining.
This is the raw-markup escape hatch for server-authored fragments. RazorWire does not encode or sanitize trustedHtml
; callers must ensure the fragment is trusted and that any user-supplied values have already been HTML-encoded. Prefer Append(string,string?)
for text and AppendPartial(string,string,object?)
or AppendComponent{T}(string,object?)
for Razor-rendered markup.
RazorWireStreamBuilder AppendPartial(string target, string viewName, object? model = null)
Queues an action to append the rendered partial view to the specified DOM target.
target
viewName
model
The current RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder Prepend(string target, string? content)
Queues a prepend action that inserts HTML-encoded text into the specified target element.
target
content
null
renders as empty text.The builder instance for fluent chaining.
RazorWire HTML-encodes content
before placing it in the stream template. Use PrependHtml(string,string?)
only for trusted, already-safe HTML fragments.
RazorWireStreamBuilder PrependHtml(string target, string? trustedHtml)
Queues a prepend action that inserts a trusted HTML fragment without encoding or sanitizing it.
target
trustedHtml
null
renders as an empty fragment.The builder instance for fluent chaining.
RazorWire writes trustedHtml
directly into the stream template. Use this only for server-authored trusted markup; encode user values before composing the fragment. Prefer Prepend(string,string?)
for text and partial or component helpers for Razor-rendered markup.
RazorWireStreamBuilder PrependPartial(string target, string viewName, object? model = null)
Queues an action to prepend the rendered partial view into the specified DOM target.
target
viewName
model
The current RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder Replace(string target, string? content)
Queues a replace action that inserts HTML-encoded text into the specified target element.
target
content
null
renders as empty text.The current RazorWireStreamBuilder instance.
RazorWire HTML-encodes content
before placing it in the stream template. Use ReplaceHtml(string,string?)
only for trusted HTML fragments.
RazorWireStreamBuilder ReplaceHtml(string target, string? trustedHtml)
Queues a replace action that inserts a trusted HTML fragment without encoding or sanitizing it.
target
trustedHtml
null
renders as an empty fragment.The current RazorWireStreamBuilder instance.
RazorWire writes trustedHtml
directly into the stream template. Use this only for server-authored trusted markup; encode user values before composing the fragment. Prefer Replace(string,string?)
for text and partial or component helpers for Razor-rendered markup.
RazorWireStreamBuilder ReplacePartial(string target, string viewName, object? model = null)
Queues a partial view to replace the contents of the specified DOM target with the rendered partial.
target
viewName
model
The same RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder Update(string target, string? content)
Queues an update action that inserts HTML-encoded text into the specified target element.
target
content
null
renders as empty text.The same RazorWireStreamBuilder instance for fluent chaining.
RazorWire HTML-encodes content
before placing it in the stream template. Use UpdateHtml(string,string?)
only for trusted HTML fragments.
RazorWireStreamBuilder UpdateHtml(string target, string? trustedHtml)
Queues an update action that inserts a trusted HTML fragment without encoding or sanitizing it.
target
trustedHtml
null
renders as an empty fragment.The same RazorWireStreamBuilder instance for fluent chaining.
RazorWire writes trustedHtml
directly into the stream template. Use this only for server-authored trusted markup; encode user values before composing the fragment. Prefer Update(string,string?)
for text and partial or component helpers for Razor-rendered markup.
RazorWireStreamBuilder UpdatePartial(string target, string viewName, object? model = null)
Queues an "update" turbo-stream action that renders the specified partial view into the given target element.
target
viewName
model
The builder instance for further chaining.
RazorWireStreamBuilder AppendComponent<T>(string target, object? arguments = null)
Queues an append action that will render the specified view component into the given DOM target.
T
ViewComponent
type to render.target
arguments
The same RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder AppendComponent(string target, string componentName, object? arguments = null)
Queues an "append" turbo-stream action that will render the specified view component (by name) into the given target element.
target
componentName
arguments
The current RazorWireStreamBuilder
instance for method chaining.
RazorWireStreamBuilder PrependComponent<T>(string target, object? arguments = null)
Queues a view component render action that will prepend the component's output into the specified DOM target.
T
target
arguments
The same RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder PrependComponent(string target, string componentName, object? arguments = null)
Queues a view component prepend action targeting a DOM element by name.
target
componentName
arguments
The current builder instance for fluent chaining.
RazorWireStreamBuilder ReplaceComponent<T>(string target, object? arguments = null)
Queues a view component replace action targeting the specified DOM element.
target
arguments
The builder instance for fluent chaining.
RazorWireStreamBuilder ReplaceComponent(string target, string componentName, object? arguments = null)
Queue a replace action that renders the specified view component by name into the given DOM target.
target
componentName
arguments
The same RazorWireStreamBuilder instance for fluent chaining.
RazorWireStreamBuilder UpdateComponent<T>(string target, object? arguments = null)
Queues an "update" turbo-stream action that renders the specified view component type into the given target element.
T
target
arguments
The same RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder UpdateComponent(string target, string componentName, object? arguments = null)
Queues a view component update action for a named view component.
target
componentName
arguments
The builder instance for fluent chaining.
RazorWireStreamBuilder OpenDialog(string title, string? message)
Queues a dialog command that opens a titled dialog containing an HTML-encoded plain-text message.
title
message
null
means an empty body.This builder for fluent chaining.
ArgumentException
title
is null, empty, or whitespace.InvalidOperationException
A builder can hold only one pending dialog payload. Calling another OpenDialog*
method while HasActiveDialog
is true throws immediately; use a ReplaceDialog*
method to explicitly overwrite the pending title and body. A null message produces an empty body. The dialog command occupies the position of the first dialog operation, so page actions retain their order around that position. The command requires request correlation and therefore can be emitted with BuildResult(int?)
or rendered with RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext,CancellationToken)
; it cannot be emitted with Build
.
RazorWireStreamBuilder OpenDialogPartial(string title, string viewName, object? model = null)
Queues a dialog command that opens a titled dialog containing a rendered partial view.
title
viewName
model
This builder for fluent chaining.
ArgumentException
title
or viewName
is null, empty, or whitespace.InvalidOperationException
Only the final buffered dialog payload is rendered. A later ReplaceDialog*
call overwrites this partial without invoking its view. The partial uses the existing trusted Razor markup boundary. The command requires request correlation, so use BuildResult(int?)
or RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext,CancellationToken)
.
RazorWireStreamBuilder OpenDialogComponent<T>(string title, object? arguments = null)
Queues a dialog command that opens a titled dialog containing a rendered view component selected by type.
T
ViewComponent
type to render.title
arguments
This builder for fluent chaining.
ArgumentException
title
is null, empty, or whitespace.InvalidOperationException
Only the final buffered dialog payload is rendered. A later ReplaceDialog*
call overwrites this component without invoking it. The component uses the existing trusted Razor markup boundary. The command requires request correlation, so use BuildResult(int?)
or RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext,CancellationToken)
.
RazorWireStreamBuilder OpenDialogComponent(string title, string componentName, object? arguments = null)
Queues a dialog command that opens a titled dialog containing a rendered view component selected by name.
title
componentName
arguments
This builder for fluent chaining.
ArgumentException
title
or componentName
is null, empty, or whitespace.InvalidOperationException
Only the final buffered dialog payload is rendered. A later ReplaceDialog*
call overwrites this component without invoking it. The component uses the existing trusted Razor markup boundary. The command requires request correlation, so use BuildResult(int?)
or RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext,CancellationToken)
.
RazorWireStreamBuilder ReplaceDialog(string title, string? message)
Replaces the pending dialog title and body with an HTML-encoded plain-text message.
title
message
null
means an empty body.This builder for fluent chaining.
ArgumentException
title
is null, empty, or whitespace.InvalidOperationException
Replacement changes the single unsent dialog slot and creates no intermediate browser command. It requires a pending open payload, as reported by HasActiveDialog
. A null message produces an empty body.
RazorWireStreamBuilder ReplaceDialogPartial(string title, string viewName, object? model = null)
Replaces the pending dialog title and body with a rendered partial view.
title
viewName
model
This builder for fluent chaining.
ArgumentException
title
or viewName
is null, empty, or whitespace.InvalidOperationException
Replacement changes the single unsent dialog slot and creates no intermediate browser command. It requires a pending open payload, as reported by HasActiveDialog
. Only the final partial is rendered.
RazorWireStreamBuilder ReplaceDialogComponent<T>(string title, object? arguments = null)
Replaces the pending dialog title and body with a rendered view component selected by type.
T
ViewComponent
type to render.title
arguments
This builder for fluent chaining.
ArgumentException
title
is null, empty, or whitespace.InvalidOperationException
Replacement changes the single unsent dialog slot and creates no intermediate browser command. It requires a pending open payload, as reported by HasActiveDialog
. Only the final component is rendered.
RazorWireStreamBuilder ReplaceDialogComponent(string title, string componentName, object? arguments = null)
Replaces the pending dialog title and body with a rendered view component selected by name.
title
componentName
arguments
This builder for fluent chaining.
ArgumentException
title
or componentName
is null, empty, or whitespace.InvalidOperationException
Replacement changes the single unsent dialog slot and creates no intermediate browser command. It requires a pending open payload, as reported by HasActiveDialog
. Only the final component is rendered.
RazorWireStreamBuilder CloseDialog()
Queues an explicit close command in the builder's single dialog slot.
This builder for fluent chaining.
Closing clears any pending open payload, so HasActiveDialog
becomes false. Repeated calls are idempotent. A later OpenDialog*
call changes the same slot to open; a close command requires BuildResult(int?)
or request-aware RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext,CancellationToken)
and cannot be emitted by Build
.
RazorWireStreamBuilder Remove(string target)
Queues a remove action targeting the specified DOM element.
target
The current RazorWireStreamBuilder
instance for fluent chaining.
RazorWireStreamBuilder Visit(string url)
Queues a one-shot Turbo Drive visit stream command that advances browser history.
url
The current RazorWireStreamBuilder
instance for fluent chaining.
ArgumentException
url
is null, empty, whitespace, or contains an ASCII control character.
RazorWire emits this command as a rw-visit
Turbo Stream action with a visit-action
value of advance
. The browser runtime validates that the resolved URL stays on the current origin before calling Turbo. Visit commands are not idempotent state snapshots, so publish them only to live subscribers and never to retained replay channels.
RazorWireStreamBuilder Visit(string url, RazorWireVisitAction action)
Queues a one-shot Turbo Drive visit stream command.
url
action
The current RazorWireStreamBuilder
instance for fluent chaining.
ArgumentException
url
is null, empty, whitespace, or contains an ASCII control character.ArgumentOutOfRangeException
action
is not a supported RazorWireVisitAction
value.
The generated stream contains no target
or template
; it is a command for the RazorWire browser runtime. Server-side validation rejects only input that cannot safely be serialized. Origin checks happen in the browser because relative URLs resolve against the current document location. Do not use this method for fallback content or replayable state; render a normal link or retained state stream for those cases.
RazorWireStreamBuilder FormError(string target, string title, string message)
Queues a form-local failure summary for an enhanced RazorWire form.
target
title
message
The current RazorWireStreamBuilder
instance for fluent chaining.
The target
value is emitted as Turbo's target
attribute, so it should name the DOM element that Turbo will update, usually a form-local error container. Calling this method marks the stream as a handled form response; BuildResult(int?)
will emit Forms.RazorWireFormHeaders.FormHandled
so the browser runtime does not add a second fallback block for the same failed submission.
RazorWireStreamBuilder FormValidationErrors(string target, ModelStateDictionary modelState, string title = "Please fix the highlighted fields.", int maxErrors = 10, string message = "We could not submit this form. Check your input and try again.")
Queues a form-local validation summary from an MVC ModelStateDictionary
.
target
modelState
title
maxErrors
message
The current RazorWireStreamBuilder
instance for fluent chaining.
The target
value is emitted as Turbo's target
attribute, so it should name the DOM element that Turbo will update. Calling this method marks the stream as a handled form response; BuildResult(int?)
will emit Forms.RazorWireFormHeaders.FormHandled
so the browser runtime does not render its default fallback UI. maxErrors
is clamped to zero or greater. RazorWire orders collected errors by error.Key
using StringComparer.Ordinal
, then renders only the first maxErrors
errors and adds an overflow line when more errors were hidden. For errors that share the same field key, original model-state insertion order is preserved. When the model state has no displayable errors, the provided message
is rendered as the fallback copy.
string Build()
Builds a single concatenated Turbo Stream markup string from the queued synchronous actions.
The concatenated Turbo Stream markup representing the queued synchronous actions.
InvalidOperationException
Task<string> RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, CancellationToken cancellationToken = default)
Renders all queued stream actions using the provided ViewContext and concatenates their rendered HTML into a single string.
viewContext
cancellationToken
The concatenated HTML string produced by rendering each queued action.
Snapshots the dialog slot before awaiting renderers and validates request correlation when a dialog is present. After successful rendering, echoes a correlated request UUID in the response's X-RazorWire-Request
header when the response has not started, so handled validation can be associated with its submission. Once response headers are read-only, the header is left unchanged. Callers own the response content type, status, and handled-form header; prefer BuildResult(int?)
when returning a controller response. See Docs/dialog-responses.md
for the complete presentation contract.
RazorWireStreamResult BuildResult(int? statusCode = null)
Creates a RazorWireStreamResult
containing the builder's queued stream actions and associated controller.
statusCode
422
for handled validation failures.
A RazorWireStreamResult
initialized with a copy of the queued actions and the builder's controller.
If FormError(string,string,string)
or FormValidationErrors(string,ModelStateDictionary,string,int,string)
was queued, the result also emits the Forms.RazorWireFormHeaders.FormHandled
response header. That header is the runtime contract that prevents the package default failed-form fallback from rendering on top of server-authored UI.
bool HasActiveDialog { get; }
Source
Gets whether this builder currently has a pending dialog open payload.
This reports only the builder's response buffer, not whether a browser currently displays a dialog. It is true after an open or replacement and false initially or after CloseDialog
.
string Render()
Renders the action as a turbo-stream HTML string.
The turbo-stream element for the action and target; for action "remove" the element has no <template>, otherwise its <template> contains the action's HTML.
Task<string> RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, CancellationToken cancellationToken = default)
Renders the action as a turbo-stream HTML string.
viewContext
cancellationToken
The turbo-stream element for the action and target; for action "remove" the element has no <template>, otherwise its <template> contains the action's HTML.
Represents an action to be performed in a RazorWire stream (e.g., append, replace).
Task<string> RenderAsync(ViewContext viewContext, CancellationToken cancellationToken = default)
Renders the stream action to an HTML string using the provided view rendering context.
viewContext
cancellationToken
The rendered HTML for this stream action.
Implements IRazorPartialRenderer
using the Razor view engine.
Task<string> RenderPartialToStringAsync(string viewName, object? model = null, CancellationToken cancellationToken = default)
Because this method executes outside of an HTTP request context, it uses a blank ActionContext
(with empty RouteData
and ActionDescriptor
). As a result, the IRazorViewEngine
may not be able to locate views that are scoped to a specific controller (e.g., Views/ControllerName/ViewName.cshtml
) unless the full path is provided (e.g., ~/Views/Reactivity/_MyPartial.cshtml
). Shared views (e.g., Views/Shared/_MyPartial.cshtml
) are generally resolvable by name.
Provides extension methods for HttpRequest
to detect Turbo requests.
bool IsTurboRequest(this HttpRequest request)
Determines whether the request's Accept header signals a Turbo Stream response.
request
HttpRequest
to check.
true
if the Accept header contains "text/vnd.turbo-stream.html", otherwise false
.
Provides static methods for creating Turbo Frame results and RazorWire stream builders.
PartialViewResult Frame(Controller controller, string id, string partialView, object? model = null)
Creates a partial result that renders a turbo frame containing the specified inner partial view and model.
controller
id
partialView
model
A PartialViewResult
that renders the RazorWire/_TurboFrame
partial populated with the specified id, partial view, and model.
Also exposes the frame identifier by setting controller.ViewData["TurboFrameId"]
.
PartialViewResult FrameComponent(Controller controller, string id, string componentName, object? model = null)
Creates a partial result that renders a Turbo Frame containing the specified view component. The frame identifier is exposed via Controller.ViewData["TurboFrameId"]
.
controller
id
componentName
model
A PartialViewResult
that renders the RazorWire/_TurboFrame
partial with a TurboFrameViewModel
.
RazorWireStreamBuilder CreateStream()
Creates a new RazorWireStreamBuilder
for fluidly configuring and producing Turbo Stream actions.
A new RazorWireStreamBuilder
instance ready to configure stream updates.
Microsoft.AspNetCore.Mvc.Rendering.ViewContext CreateViewContext(this Controller controller)
Creates a Microsoft.AspNetCore.Mvc.Rendering.ViewContext
configured to render outside of a regular view using the controller's context and data.
controller
Microsoft.AspNetCore.Mvc.Rendering.ViewContext
.
A Microsoft.AspNetCore.Mvc.Rendering.ViewContext
configured with the controller's data and a no-op view.
Task RenderAsync(Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext)
A no-op view that does not render any content.
viewContext
A completed Task
.
Data model used for rendering the Turbo Frame partial view.
string Id { get; set; }
Source
Gets or sets the unique identifier for the Turbo Frame.
string? PartialView { get; set; }
Source
Gets or sets the name of the partial view to render inside the frame, if any.
string? ViewComponent { get; set; }
Source
Gets or sets the name of the view component to render inside the frame, if any.
object? Model { get; set; }
Source
Gets or sets the optional model to pass to the partial view or view component.
Describes how Turbo Drive should apply a RazorWire visit stream command to browser history.
Visit stream commands are one-shot navigation messages. Publish them only to live stream subscribers; do not retain or replay them through a RazorWire stream hub replay buffer. Use normal links, redirects, or retained state streams when late subscribers or JavaScript-disabled clients need a fallback.
Identifies how the selected dialog body is rendered.
Identifies which dialog flow a package-authored target action belongs to in one response.
Identifies the final dialog command represented by a response.