SaaS CMS has officially launched! Learn more now.

an oldie - how to disable contextmenu right click


Ok this is an old one, long forgotten but we got a customer that wants to do it. Episerver 4.x

Can someone remind me how to disable the contextmenu (right click menu in doap)?

Thanks in advance!

Sep 22, 2008 17:37
Sep 22, 2008 20:52

Why did you remove the RightClickMenu attribute in CMS 5? It was very useful in CMS 4. Or did it move somewhere else?


Example disables the menu on a template
public class StandardPage : TemplatePage


Edited, Sep 23, 2008 0:51


If you want to disable DOPE (Direct On Page Edit) you can change to inherit from SimplePage, or set the episerver property "Editable" to false.

E.g. <episerver:property propertyname="PageName" runat="server" Editable='false' />

Search in the old 4.x. sdk for "editable" and you'll get more info.

-- Per

Sep 23, 2008 13:21

Unless my memory serves me wrong, wasn't there a simple change in the web.config that would turn off the right click menu completely?

We want to do it for the entire site, not just individual temples or controls.

Sep 24, 2008 12:49

I thought I had it solved. There's a class one can use (or so I thought).

RightClickMenuAttribute.Current.Disabled = true;

So I put this code in Page_Load but nothing happens! The right click menu pops up all the same.

So if anyone have suceeded in turning this off for a whole site at once, please tell. 

Sep 30, 2008 14:07

I got rid of the contextmenu...

I changed to inherit from SimplePage on a page where I also have a stripped fckeditor.

Sep 30, 2008 15:21

I have the same issue, wanting to remove the DOPE, New and Quick-Edit options from the menu but leaving the other options.

The simple answer is to create your own class inheriting from TemplatePage and then, in hte onLoad event iterating through the ContextMenu's Items collection, switch those I don't want off.

string[] DisabledMenuOptions = WebConfigurationManager.AppSettings["DisabledMenuOptions"].Split(new char[] {'|'});
for (int i = 0; i < this.ContextMenu.Menu.Items.Count; i++ )
if (DisabledMenuOptions.Contains(this.ContextMenu.Menu.Items[i].Caption))
this.ContextMenu.Menu.Items[i].EnabledScript = "false";


 In theWebConfig I have an appSetting called DisabledMenuOptions set to "Edit|Save and Publish|Cancel|New|Quick-edit".

 Hope this helps?




Jan 26, 2009 17:31

or use

ContextMenu.Options &= ~EPiServer.Web.PageExtensions.ContextMenuOption.OnPageEdit;



Jan 30, 2009 10:08
* 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.