Back to Devexpress

DxHtmlEditor.MarkupChanged Event

blazor-devexpress-dot-blazor-dot-dxhtmleditor-1e4c0dbb.md

latest2.1 KB
Original Source

DxHtmlEditor.MarkupChanged Event

Fires when the Markup property value changes.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public EventCallback<string> MarkupChanged { get; set; }

Parameters

TypeDescription
String

The editor markup.

|

Remarks

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.

Example

The following code snippet validates user input in the MarkupChanged event handler:

razor
<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

DxHtmlEditor Class

DxHtmlEditor Members

DevExpress.Blazor Namespace