<p>Currently I am working with a <strong>custom</strong> regular expression validator <em>(unfortunately)</em>.</p>

<p>I am trying to set the Regex pattern using a server side inline script like this:</p>

<pre><code>ValidationExpression="&lt;%= RegExStrings.SomePattern %&gt;"
</code></pre>

<p>However, the script is not resolving to server side code. Instead it is being interpreted literally and I end up with something like this in the rendered markup:</p>

<pre><code>ctl00_DefaultContent_regexValidatorInvitation.validationexpression = "&lt;%= RegExStrings.SomePattern %&gt;";
</code></pre>

<p>Any clues as to why this is not resolving properly?</p>

Values in a web control do not render server side code.
Rather set that from the Code Behind
```
```
RegExValidator1.ValidationExpression = RegExStrings.SomePattern;
```
```