How could i include the custom css & JavaScript for particular module in DotnetNuke?
I understand that it is not like normal ASP.Net page.
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.
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.
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With