Call javascript from server side on postback
<pre><code>var r = {  
        init : function(){  
             r = Raphael("pie");
            //r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";
            r.g.text(320, -330, "Message Status").attr({ "font-size": 20 });

            var pie = r.g.piechart(360, -180, 100,  &lt;%= Session["uStats"] %&gt;, { legend: [&lt;%= Session["vkeyColor"] %&gt;], colors: [&lt;%= Session["vPieColor"] %&gt;]  });
            pie.hover(function () {
                this.sector.stop();
                this.sector.scale(1.1, 1.1, this.cx, this.cy);
                if (this.label) {
                    this.label[0].stop();
                    this.label[0].scale(1.5);
                    this.label[1].attr({ "font-weight": 800 });
                }
            }, function () {
                this.sector.animate({ scale: [1, 1, this.cx, this.cy] }, 500, "bounce");
                if (this.label) {
                    this.label[0].animate({ scale: 1 }, 500, "bounce");
                    this.label[1].attr({ "font-weight": 400 });
                }
            });
            var r = Raphael("pie"),

                    data2 = [&lt;%= Session["vProgressPercentage"] %&gt;];
                    axisx = ["10%", "20%"];
            r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";
             r.g.barchart(80, 25, 100, 320, data2, { stacked: true, colors: [&lt;%= Session["vProgressColor"] %&gt;,'#fff'] });
             axis2 = r.g.axis(94, 325, 280, 0, 100, 10, 1);
        }
        }
          window.onload = function () {
          r.init();
        };
</code></pre>

<p>The Javascript is executed when the page loads, I do partial postback using a update panel, the javascript is not executed during post back how to call it from server side.</p>

<pre><code>  &lt;asp:ScriptManager ID="smCharts" runat="server" /&gt;
   &lt;script type="text/javascript" language="javascript"&gt;
             Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
             Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
             function BeginRequestHandler(sender, args) {
                 r.init();
             }
             function EndRequestHandler(sender, args) {
                 r.init();
             }

            &lt;/script&gt;
        &lt;asp:UpdatePanel runat="server" ID="Holder" OnLoad="messsagePercentStats" UpdateMode="Conditional"&gt;
            &lt;ContentTemplate&gt;

                &lt;div id="pie" onclick="__doPostBack('Holder', '');" style="top: -125px; left: -20px; width: 610px; position: relative;
                    height: 389px;"&gt;
                &lt;/div&gt;
</code></pre>

<p>This is what I am trying and the graph is not changed. it remains constant as in page load</p>

<pre><code>protected void Timer_Tick(object sender, EventArgs args)
    {
        String MsgID = HttpContext.Current.Request.QueryString["MsgID"];
        int msgID = Convert.ToInt32(MsgID);
        BindGridViewUsers(msgID);

        ClientScript.RegisterStartupScript(this.GetType(), "loadpie", "r.init();");
        Holder.Update();
        }
</code></pre>
