Dynamic javascript from web resource
<p>I have written a custom web control that validates some input to a textbox client-side. The associated JavaScript is an embedded resource. As part of the validation process the JavaScript displays a confirm alert box.</p>

<p>I want to be able to set the message of the alert from a property of web control, in a similar way to the standard asp.net validation controls have the ErrorMessage property.</p>

<p>Can anyone advise me on the best way to splice this property into my embedded JavaScript?</p>

<p>Embedded js function</p>

<pre><code>function checkDeduction(sender, eventArgs) {
    var dNewVal = eventArgs.get_newValue();
    if (dNewVal &gt; 0) {
        var bRetVal = confirm("custom msg here");
        if (!bRetVal) {
           dNewVal = dNewVal * -1;
           sender.set_value(dNewVal);
        }
    }
}
</code></pre>
