I m calling ScriptManager.RegisterStartupScript inside a selectedeventcahnged event but i hv observed that some time it do not calls the
Below is code .
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction1", " fillData('" + myvalue + "');", true); do not calls javascript function
protected void ddlInvoice_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction", "LoadCustomerDetailsINdiv('" + Imgsbuilder + "');", true);
if (ddlCorporation.SelectedIndex > 0 && ddlClient.SelectedIndex > 0)
{
ds.Reset();
ds = myDB.GetInvoice(clientVal, InvType);
if (ds == null)
{
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction3", "fillInvoice('" +""+ "');", true);
}
else if(ds.Tables[0].Rows.Count == 0)
{
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction3", "fillInvoice('" + "" + "');", true);
}
else if (ds.Tables[0].Rows.Count > 0)
{
string Invoice = Convert.ToInt32(ds.Tables[0].Rows[0]["TM_TemplateID"]); // This will be use in updating the Texteditorcontent
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction1", "fillInvoice('" + Invoice + "');", true);
}
}
}
catch (Exception exp)
{
;
}
}
Also i hv observed tht some time if i debugg then it will hit javascript function .
Pls suggest