Server.Execute does not fire JavaScript function
<p>Need help understanding how I can resolve the following:</p>

<p>I have a page that works out height of a DIV and posts the value in json to webmethod, code shown below:</p>

<p>//Page 1</p>

<pre><code>    &lt;script type="text/javascript"&gt;
           function GetH() {
               var minHeight = $(".toResize").height();
               $.ajax(
               {
                   type: "POST",
                   url: "page1.aspx/divHeight",
                   data: "{'size': '" + minHeight + "'}",
                   dataType: "json",
                   contentType: "application/json"
               });
           }

&lt;/script&gt;

&lt;div class="toResize"&gt;&lt;asp:Literal ID="LB_text" runat="server"&gt;&lt;/asp:Literal&gt;     &lt;/div&gt;

    protected void Page_Load(object sender, EventArgs e)
{
        if (Request["qs"] != null)
        {
    LB_text.text = "hello world";
Page pg = (Page)HttpContext.Current.Handler;
                    ScriptManager.RegisterStartupScript(pg, pg.GetType(), "Pot", " GetH();", true);                

        }


    }
</code></pre>

<p>Now what am trying to do is I want to call this page dynamically from another page to get the value and update the db. But my problem is I can use the code below and literal changes text but function GetH() does not fire, tried doing document ready but again JavaScript does not fire. </p>

<p>//Page 2</p>

<pre><code>   string url = "page1.aspx?qs=3";

            Server.Execute(url, htmlStringWriter);
            string htmlCodeToConvert = htmlStringWriter.GetStringBuilder().ToString();
            htmlStringWriter.Close();
</code></pre>

<p>Also tried using WebRequest but again nothing worked. Any ideas would be great </p>

<p>cheers.</p>
