Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Check if user is in edit mode inside a custom property



Is it possible to check if a user is in edit mode inside a custom property? EPiServer.Editor.PageEditing.PageIsInEditMode is always false



Mar 22, 2013 15:11

That property should work. Is this a EPiServer 6 style custom property appearing in the new edit view?

Mar 22, 2013 15:53

Hi Ben,

Yes, this is a EPiServer 6 style custom property. Is it possible to use any other property in EPiServer to determine if we are in edit mode or not?

Mar 22, 2013 16:03

I've just investigated the legacy properties dialog and it seems there is a bug. The URL to load the custom property doesn't contain epieditmode=true in the query string.

This means that PageIsInEditMode will always return false since that property will only ever be true if the URL contains epieditmode=true in the query string.

I'll log a bug for this.

I'm not sure how you could work around this. My first suggestion would be to try convert the property to an EPiServer 7 style custom property.

Mar 22, 2013 16:20

Do you mean inside a CMS 6 property control? I don't think we should or need to use the PageIsInEditMode property since legacy editor dialog is not actually new edit mode :).

By the way, checking the control's RenderType property can help in this case. 

Edited, Mar 22, 2013 16:50

Inside a MVC view I use 






which is from EPiServer.Editor namespace


You also need to be on EPiServer 7 - patch 1

Edited, Mar 22, 2013 17:02

Hi Ben,

thanks for finding that out! Could you also check why the PageLink is Null here?

@Duong Nguyen: I am inside the PropertyData class and not the PropertyDataControl.

@EPiDev: I am inside the PropertyData class, so this won`t help me much....

Mar 22, 2013 19:12

Hi Ben,

Is this bug still there in EPiServer 7 Patch 4? Another thing, PageLink is also null here. Is this also a bug?

Dec 20, 2013 9:29
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.