Try our conversational search powered by Generative AI!

How to know if async block is rendered in edit mode


We have a landing page after login where different blocks are rendered async (call from the browser) 

All the blocks communicate with our internal API. I have created stub data for all the API endpoints. The problem I am facing is that PageEditing.PageIsInEditMode is true for the page but returns false for every embedded block except Block A which is not rendered async via user browser

The blocks are rendered async via JavaScript called from the landing page -> FetchAsynBlock?blockId=10

Due to this error the page is not rendering in view mode.

What can be dont to overcome this issue ? 

Edited, Jul 29, 2021 12:18

I am not 100% I understand your issue but since you are effectively client side rendering there are some properities like epi.InEditMode which might help. See the links below for some more information: 

Aug 06, 2021 15:39

Thanks for your reply.

The issue is that I am loading page and then loading content (blocks) later via JQuery callback, which delivers markup back to the page.

On loading content via JQuery PageIsInEditMode returns false

This is the script that runs on user browser 

                .load('@Response.ApplyAppPathModifier(string.Format("/FetchAsynBlock?blockId={0}", Model.BlockProperty))',
                    function (respText, statusText, xhr) {
Edited, Aug 09, 2021 8:33

You may be able to the epi object as described here: look for "Handling context modes"

Aug 09, 2021 9:31
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.