New to Telerik UI for ASP.NET Core? Download free 30-day trial

ImageEditor in Razor Pages

Razor Pages is an alternative to the MVC pattern that makes page-focused coding easier and more productive. This approach consists of a cshtml file and a cshtml.cs file (by design, the two files have the same name).

You can seamlessly integrate the Telerik UI ImageEditor for ASP.NET Core in Razor Pages applications.

This article describes how to configure the ImageEditor component in a Razor Pages scenario.

For the complete project, refer to the ImageEditor in Razor Pages example.

The example below demonstrates how to configure the ImageEditor to forward the content to a proxyURL in a Razor Pages scenario even if the browser supports saving files locally.

    @inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf

        .SaveAs(s => {
            s.ProxyURL(Url.Page("ImageEditorIndex", "Save"));

    @inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf

    <kendo-imageeditor name="imageEditor" height="900" image-url="@Url.Content("~/image/2.jpg")">
        <save-as file-name="image.png" 

    public IActionResult OnPostSave(string contentType, string base64, string fileName)
        var fileContents = Convert.FromBase64String(base64);

        return File(fileContents, contentType, fileName);

See Also

In this article