Pass an asp.net variable to javascript failed
<p>I am going to pass an variable from asp.net server to the javascript but I got an exception.</p>

<blockquote>
  <p>The name 'serializer' does not exist in the current context
  In my Admin.aspx.cs</p>
</blockquote>

<pre><code> protected static string urlEdit;
    protected void Page_Load(object sender, EventArgs e)
    {
        // blah blah...
        var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
    }
</code></pre>

<p>Then in the markup code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
            function Edit_Click() {
                var options = SP.UI.$create_DialogOptions();


                options.url = &lt;%= serializer.Serialize(urlEdit) %&gt;;

                              };
</code></pre>
