I have an image component for which I need to disable its editing ribbon on Sitecore Page Editor so that the author is unable to edit/change the image.
In code:
<sc:Image Field="Image" ID="Image1" runat="server">
I have tried DisableWebEditing="true"
but of no use !
Also tried this in code behind
if (Sitecore.Context.PageMode.IsPageEditor)
{
Image1.DisableWebEditing = true;
}`
How do i disable the image editing?
I would have expected the change you have made to work in disabling the web edit functionality. Are you testing as an "is administrator" functionality? I know that Page Editor will occasionally provide full admins more access.
If you do not want it to ever be edited, you can also consider use an ASP.NET image control and updating it with the data from the media item.