sourabh_bansal
sourabh_bansal

Reputation: 73

DNN TextEditor Not Working When Applying CSS

Does DNN Texteditor not work when we apply the CSS?

I see the following error: 'System.Web.UI.UserControl' does not contain a definition for 'Mode' and no extension method 'Mode' accepting a first argument of type 'System.Web.UI.UserControl' could be found (are you missing a using directive or an assembly reference?)

Upvotes: 0

Views: 411

Answers (1)

bdukes
bdukes

Reputation: 156075

It looks like you're running into an issue where the type of the text editor control isn't known, so when you access it from codebehind, it's typed as a UserControl, instead of a DotNetNuke.UI.UserControls.TextEditor.

This is because you're referencing a control from the DotNetNuke source, which isn't part of your module's project, so Visual Studio doesn't know what you're talking about. The first way to get around this is to move the control's declaration from the designer file to your codebehind, and change the type to be TextEditor instead of UserControl.

The better way to get around this is to change the properties of your project to point to the DNN site, so Visual Studio can know about the control. This requires having your project live inside of a DNN site which is registered with IIS. You can then go to the Web tab within the project's settings, and in the Servers section, check the Use Local IIS Web server radio button. Then set the Project Url to point to your module's folder (e.g. http://dnndev.me/DesktopModules/MyModule). Check the Override application root URL check box, and enter the root of the site there (e.g. http://dnndev.me). This should allow Visual Studio to find the control and parse the correct type from it. You may need to make a change in the ascx control and re-save it before it'll be correctly updated.

Upvotes: 1

Related Questions