CSP Nonce

The CspNonce template part renders a nonce value.

Syntax

<% CspNonce %>

Example

<html>
<head>
    <style nonce="<% CspNonce %>">
        body {
            background: tomato;
        }
    </style>
</head>
<body>
    <!-- Body content -->
    <script nonce="<% CspNonce %>">
        console.log("Hello, World!");
    </script>
    <!-- Body content -->
</body>
</html>

Last updated

Was this helpful?