Know of a good way to clean a string in .net to be used in Javascript?
<p>I am creating a javascript confirm message in my asp.net code:</p>

<pre><code>deleteButton.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to delete client " + clientName + "')");
</code></pre>

<p>The problem here is that the client name can have apostrophes and other problematic characters.</p>

<p>Does anyone know a <i>good, simple</i> way to clean the variable "clientName" so that I can safely use it in the javascript?</p>

<p>Thanks!</p>
