if you want to modify the client side after render, try to use the function RegisterStartupScript, the script block added by the RegisterStartupScript method executes when the page finishes loading but before the page’s OnLoad event is raised
public String GetNewKey()
{
String _string_key = String.Empty;
Guid _guid = Guid.NewGuid();
foreach (char _char in Convert.ToBase64String(_guid.ToByteArray()))
{
_string_key += char.IsLetterOrDigit(_char) ? _char.ToString() : string.Empty;
}
return _string_key;
}
public void RunScript(String _script)
{
String function = @"<script type='text/javascript'> $(function () { " + _script + " }); </script>";
this.ClientScript.RegisterStartupScript(_page.GetType(), Utilities.GetNewKey(), function, false);
}