DotNetNuke Tip #17, Disable Inline Editing in Text/HTML

DotNetNuke Tip #17, Disable Inline Editing in Text/HTML

With the latest releases of DNN, 3.3.* and 4.3.*, you may notice that when logged in to a page you have edit rights to that you can "edit" content in the text/html modules simply by clicking on them in the browser window and typing. Convenient, yes? Sometimes! Othertimes it can really be a pain in the rear, I'm a click happy person, I click places so I can get my scroll started, so that last thing I want is to begin editing content on my pages.

I figured I'd post a solution to disable this option in DNN. Currently this requires a recompile, though I know the core team is looking at how to make this an option for the Text/HTML module.

So here's what you need to do.

Download the Source Version of the Text/HTML project from DotNetNuke.com

Open the Project in VS 2003, I opened it in an existing DNN solution I had setup already.

Open the HtmlModule.ascx.vb file

Around line 196 you'll find the following code

lblContent.EditEnabled = Me.IsEditable

Comment that line out and add the following line

'lblContent.EditEnabled = Me.IsEditable
lblContent.EditEnabled = False

Recompile the module in release mode and use the newly created DLL in your environments. Always Test new code/dlls on a test instance before moving them into production. The above code worked fine for me, but please test for yourself first.

Stay tuned for more DotNetNuke tips, brought to you by Chris Hammond from Engage Software.

1 Comment

  • I need your help with something similar... i have look on the dnn forums but no one has answer me.
    I want to disable the HTML posting on the FCKeditor for secutiry reasons because users can post javascript code that is dangerous in many ways especially on forums.
    Thanks!
    alterego_1981@hotmail.com

Comments have been disabled for this content.