The new way to do this (v12.02 and newer) is to let the IPageService take care of this. This works in Dnn and Oqtane. Like this:

var page = GetService<ToSic.Sxc.Web.IPageService>();
page.Activate("jQuery");
 

The old way which will only work in Dnn is to tell DNN that your code needs jQuery, you must use RequestRegistration. Add this code:

@using DotNetNuke.Framework.JavaScriptLibraries;
@{   JavaScript.RequestRegistration(CommonJs.jQuery);
}
open_in_new open in new window
code Share
code
URL copied to clipboard.
Embed Checklist close
Copy Copy
Content Copyright

CC-BY 4.0

Translations

None

DNN Community Logo

DNN Community

QR-Code
azing.org/dnn-community
/r/YqJFbNKH
close

Durchsuche ganz Azing