HtmlCspExtensions.CspNonce method
namespace: Serenity.Web assembly: Serenity.Net.Web
Gets a nonce value for use in script and style elements. Automatically generates and stores it in the current HTTP context items and adds it to the CSP directives.
public static string CspNonce(this IHtmlHelper html, bool addDirectives = true)
| parameter | description |
|---|---|
| html | The HTML helper. |
| addDirectives | true to add CSP directives for script-src, style-src, font-src. |
Return Value
The generated nonce value.
See Also
- class HtmlCspExtensions