AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

AdvantageCommonBasePage..::..RemapToEventHandlers Method

Finds every inline onclick handler in the supplied HTML and rewrites the page to attach the same handler via addEventListener from a CSP-nonced <script> block injected before the closing </body>. Lets strict CSP policies block inline event handlers without breaking existing markup.

Namespace:  AdvantageCMS.Core.Common.BaseClasses
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


protected string RemapToEventHandlers(
	string content
)

Parameters

content
Type: String
The HTML content to scan and rewrite.

Return Value

The rewritten HTML with inline handlers moved into an addEventListener script block.

See Also


AdvantageCommonBasePage