Automatically refresh page in Sitecore Experience Editor after updating a component

“EditFrames in the Experience Editor is a feature that you can use to give users front-end access to fields that are not directly accessible, either because they are not visible or they are of a type that are not directly front-end editable.”

When editing a component using EditFrames or the Editor Button, the component datasource does not refresh. To do this, you have to save the page first, followed by reloading the page with the latest changes, which is cumbersome for content editors.

Changing this behavior can be changed by overriding Pipelines, one of Sitecore’s essential integration concepts.


public void Process(ReturnFieldEditorValuesArgs args)
    Assert.ArgumentNotNull(args, nameof(args));

    args.Options.SaveItem = true;
    foreach (FieldInfo fieldInfo in args.FieldInfo.Values)
        Control subControl = Context.ClientPage.FindSubControl(fieldInfo.ID);
        if (subControl == null) continue;

        var value = subControl is IContentField
            ? StringUtil.GetString((subControl as IContentField).GetValue())
            : StringUtil.GetString(ReflectionUtil.GetProperty(subControl, "Value"));

        if (value == "__#!$No value$!#__") continue;

        string type = fieldInfo.Type.ToLowerInvariant();
        if (type == "rich text" && type == "html") continue;

        value = value.TrimEnd(' ');

        foreach (FieldDescriptor fieldDescriptor in args.Options.Fields)
            if (fieldDescriptor.FieldID != fieldInfo.FieldID) continue;

            ItemUri itemUri = new ItemUri(fieldInfo.ItemID, fieldInfo.Language, fieldInfo.Version,
            if (fieldDescriptor.ItemUri == itemUri)
                fieldDescriptor.Value = value;
            Item item = Factory.GetDatabase(fieldDescriptor.ItemUri.DatabaseName)

            if (item == null) continue;

            item.Fields[fieldInfo.FieldID.ToString()].Value = value;


public void Process(ReturnFieldEditorValuesArgs args)
    Assert.ArgumentNotNull(args, nameof(args));



Create a Sitecore Patch file

Create a new Patch file inside the /App_Config/Include folder. Below an example of a Sitecore patch file including a custom pipelines is added.

<configuration xmlns:patch="">
            <processor type="YourNameSpace.SetValues, YourAssembly"
            patch:instead="processor[@type='Sitecore.Shell.Applications.ContentManager.ReturnFieldEditorValues.SetValues']" />
            <processor type="YourNameSpace.ReturnAndClose, YourAssembly"
            patch:instead="processor[@type='Sitecore.Shell.Applications.ContentManager.ReturnFieldEditorValues.ReturnAndClose']" />