AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

ResourceRegister..::..RegisterScript Method

Registers a startup script on the page, automatically injecting CSP nonce and using ScriptManager when available.

Namespace:  AdvantageCMS.Core.Utils
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public static void RegisterScript(
	Page page,
	Control ctrl,
	string key,
	string script,
	bool scriptTags
)

Parameters

page
Type: Page
The current page.
ctrl
Type: Control
The control requesting the script registration.
key
Type: String
A unique key to prevent duplicate registrations.
script
Type: String
The JavaScript content to register.
scriptTags
Type: Boolean
If true, wraps the script in script tags.