My DotNetNuke ramblings
 

Quick Tip: My solution for body background showing in FKC editor

IF you develop skins and given the body a background color or image this also shows through in the background of the FKC editor. This is my solution that can be used in .ascx skins.

Instead of applying the class directly to the body like this

body{background-color:red;}

You apply a class to the body and apply the styles to that class

.body{background-color:red;}

All you need is paste the following code-block above the first html in your .ascx skin.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyBody As Control = Me.Page.FindControl("Body")
Dim objMyBody = CType(MyBody, System.Web.UI.HtmlControls.HtmlGenericControl)
objMyBody.Attributes.Add("class", "body")
End Sub

Off course this is not needed anymore with the Telerik editor in the latest DotNetNuke 5 but not everyone has upgraded yet.

 

Posted in: Quick Tip