Custom Modules

Snippets

18

How to Add Javascript to a DNN Page header section in a Custom Module

protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            DotNetNuke.Web.Client.ClientResourceManagement.ClientResourceManager.RegisterScript(this.Page, "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit", FileOrder.Js.DefaultPriority, "DnnPageHeaderProvider");
          
        }

Posted in: DNN, Custom Modules

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.