blazor-devexpress-dot-blazor-dot-dxhtmleditor-1e4c0dbb.md
Fires when the Markup property value changes.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[Parameter]
public EventCallback<string> MarkupChanged { get; set; }
| Type | Description |
|---|---|
| String |
The editor markup.
|
Handle the MarkupChanged event to respond to the Markup change. You do not need to handle this event to update markup source when you use two-way data binding for the Markup property (@bind-Markup).
Note
The editor updates the Markup property value based on BindMarkupMode.
The following code snippet validates user input in the MarkupChanged event handler:
<DxHtmlEditor Markup="@markup"
IsValid="@isValid"
ValidationMessage="Empty markup."
ValidationMessagePosition="HtmlEditorValidationMessagePosition.Right"
MarkupChanged="@OnMarkupChanged"
Height="100px"
Width="80%" />
@code {
bool isValid;
string markup { get; set; } = "";
void OnMarkupChanged(string newValue) {
markup = newValue;
isValid = !string.IsNullOrEmpty(newValue);
}
}
See Also