try this i will help you....
private string getjQueryCode(string jsCodetoRun)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("$(document).ready(function() {");
sb.AppendLine(jsCodetoRun);
sb.AppendLine(" });");
return sb.ToString();
}
private void runjQueryCode(string jsCodetoRun)
{
ScriptManager requestSM = ScriptManager.GetCurrent(this);
if (requestSM != null && requestSM.IsInAsyncPostBack)
{
ScriptManager.RegisterClientScriptBlock(this,
typeof(Page),
Guid.NewGuid().ToString(),
getjQueryCode(jsCodetoRun),
true);
}
else
{
ClientScript.RegisterClientScriptBlock(typeof(Page),
Guid.NewGuid().ToString(),
getjQueryCode(jsCodetoRun),
true);
}
} call runjQueryCode funtion where you want with param
runjQueryCode("setName('div1');");
* you must add JQuery reference
Please "Mark As Answer" if helpfull..
Feroze Ahmed