title: html dropdownlist helper in javascript
body: <p>I'd to set a local javascript variable to the output of an html helper. See the following snippet for an example:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
       $(function () {
                var dtypes = '@Html.DropDownList("TypeId",new SelectList(@ViewBag.MyTypes,"Value","Text"))';
        });
        alert(dtypes);
  &lt;/script&gt;
  </code></pre>
  
  <p>This doesn't give me an alert. Am I doing something wrong?
  Thanks for any help.</p>