PastedImageSavingEventArgs.SetStyleAttribute(String, String) Method
Specifies a CSS property in the ‘style’ attribute of the resulting HTML element.
Namespace: DevExpress.Web.ASPxHtmlEditor
Assembly: DevExpress.Web.ASPxHtmlEditor.v24.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
name | String | A string value specifying the style attribute name. |
value | String | A string value specifying the style attribute’s new value. |
Remarks
The following examples illustrate how to use the ASPxHtmlEditor.PastedImageSaving event and the SetStyleAttribute method to add inline CSS style attributes to the pasted element.
protected void ASPxHtmlEditor1_PastedImageSaving(object source, PastedImageSavingEventArgs e) {
e.SetStyleAttribute("max-width", "100%");
e.SetStyleAttribute("border", "1px solid #aaa");
}
protected void ASPxHtmlEditor1_PastedImageSaving(object source, PastedImageSavingEventArgs e) {
if (!e.IsValid) {
e.TagName = "DIV";
e.InnerHTML = "<img src='broken-image.png' />";
e.SetStyleAttribute("border", "1px dotted #f00");
}
}
See Also