Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS In DNN Modules

Tags:

dotnetnuke

How could i include the custom css & JavaScript for particular module in DotnetNuke?

I understand that it is not like normal ASP.Net page.

like image 792
guna Samba Avatar asked Dec 08 '12 18:12

guna Samba


People also ask

What are DNN modules?

Modules extend the functionality of the DNN framework. As DNN is architected in a modular fashion the term “modules” makes sense as a module represents a set of re-usable code that can be installed into any DNN site. Once installed into DNN modules can easily be dragged and dropped to a page.

What is Skin CSS?

Styles for RadControls are defined using Cascading Style Sheet (CSS) syntax. Each style consists of a selector that identifies an HTML element to be styled, and property/value pairs that describe each of the style specifics, e.g. color, padding, margins, etc.


1 Answers

If your module has a file named module.css in the root of the module folder, it will automatically get included on the page with the module.

For other CSS and for JavaScript, you should use the Client Resource Management framework to include the resources you want. Something like this:

<%@ Register TagPrefix="dnn" 
    Namespace="DotNetNuke.Web.Client.ClientResourceManagement" 
    Assembly="DotNetNuke.Web.Client" %>
 
<dnn:DnnCssInclude runat="server"
    FilePath="~/DesktopModules/MyModule/css/the-style.css" />
<dnn:DnnJsInclude runat="server"
    FilePath="~/DesktopModules/MyModule/js/the-script.js"
    ForceProvider="DnnFormBottomProvider" />
like image 125
bdukes Avatar answered Sep 24 '22 23:09

bdukes