Skip to main content
All docs
V25.2
  • ASPxRichEditUriValidationContext.Editor Property

    Returns the ASPxRichEdit component initiated URI validation.

    Namespace: DevExpress.Web.ASPxRichEdit

    Assembly: DevExpress.Web.ASPxRichEdit.v25.2.dll

    NuGet Package: DevExpress.Web.Office

    Declaration

    public ASPxRichEdit Editor { get; }

    Property Value

    Type Description
    ASPxRichEdit

    An ASPxRichEdit instance.

    Remarks

    Use the Editor property to access the ASPxRichEdit component instance in URL validation handlers. Note that Editor property value can be null in the following cases:

    • You import documents that contain external images.
    • You insert images via the UI, clipboard, or API.

    Use the DocumentInfo property instead to identify the event sender.

    The following code snippet enables requests to internal network resources in the specified Rich Text Editor document:

    using System;
    using DevExpress.Security.Resources;
    using DevExpress.Web.ASPxRichEdit;
    
    protected void Application_Start(object sender, EventArgs e) {
        AccessSettings.UriValidated += OnUriValidated;
    }
    
    void OnUriValidated(object sender, UriValidatedEventArgs e) {
        // Checks if a validation request comes from ASPxRichEdit
        if(e.ValidationContext is ASPxRichEditUriValidationContext richEditContext) {
            if(richEditContext.DocumentInfo.DocumentId == "MyDocumentId" && e.Uri != null) {
                // Specifies allowed hosts
                if(e.Uri.IdnHost.Equals("localhost", StringComparison.OrdinalIgnoreCase)) {
                    e.Valid = true;
                }
            }
        }
    }
    
    See Also