Assume you have a control named "TextBox1" in aspx file, and its value is "2"
so, your aspx file like this:
ShowValue = function()
[form id="form1" runat="server"]
[asp:TextBox ID="TextBox1" runat="server" Text="2"][/asp:TextBox]
now, in server-side, at Page_Load method, you set value of "TextBox1" to "9" and call "ShowValue" from server.
TextBox1.Text = "9";
Page.ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "ShowValue()", true);
The RegisterClientScriptBlock method adds a script block to the top of the rendered page.
while, the script block added by the RegisterStartupScript method executes when the page finishes loading but before the page's OnLoad event is raised.
(it means the RegisterStartupScript method adds a script block to the end of the rendered page.)
Mahesh K. Sharma