PastedImageSavingEventArgs.SetAttribute(String, String) Method
Specifies any attribute (including the data-* attributes) of the resulting HTML element.
Namespace: DevExpress.Web.ASPxHtmlEditor
Assembly: DevExpress.Web.ASPxHtmlEditor.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Parameters
Name | Type | Description |
---|---|---|
name | String | A string value specifying the attribute name. |
value | String | A string value specifying the attribute’s new value. |
Remarks
The following example illustrates how to use the ASPxHtmlEditor.PastedImageSaving event and the SetAttribute method to add attributes to the pasted element.
protected void ASPxHtmlEditor1_PastedImageSaving(object source, PastedImageSavingEventArgs e) {
if (!e.IsValid) {
e.SetAttribute("data-isvalid", "false");
e.SetAttribute("src", "broken-image.png");
e.SetAttribute("alt", "broken image");
}
}
See Also