SaaS CMS has officially launched! Learn more now.

Make property read-only in Editmode


Is there a way to make a property read-only in edit mode? We have pages created from another source and some of the values is not to be changed in EPiServer but they must be visible to the editor. So to hide it in edit mode is not enough since it should be visible but editable.

Aug 20, 2013 11:47

According to the documentation you should be able to set either the Editable or ReadOnly attributes to control this (

Aug 20, 2013 12:52

Yes, can't believe I missed that...

Aug 20, 2013 13:12

Is this possible in CMS 6 R2? I can't find anywhere how to accomplish this.

Oct 16, 2013 16:54

Persyl: I don't think so. I'ts possible to accomplish with a custom property though.

Oct 16, 2013 17:45

What I've done in CMS 6 is to create a custom property type called PropertyReadOnlyString inheriting PropertyString and then simply add a "disabled" attribute when the edit control is created. Same can be applied to PropertyLongString, PropertyNumber, etc.

Edited, Oct 16, 2013 23:31

I did the same solution as Ted.

This is what you need to do in the CreateEditControls() method of the Control class.

public override void CreateEditControls()
this.EditControl.Attributes.Add("disabled", "disabled");


Oct 17, 2013 8:41
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.