DxHtmlEditor.MarkupChanged Event
Fires when the editor markup changes.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public EventCallback<string> MarkupChanged { get; set; }
Parameters
Type | Description |
---|---|
String | The editor markup. |
Remarks
Handle the MarkupChanged
event to respond to the Markup change. Note that 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
).
Example
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