I'm adding user control dynamically on my page.
MyPage.aspx:
MyControl cntl = (MyControl)Page.LoadControl("MyControl.ascx");
The MyControl.ascx has a javascript function:
function myfun(a, b)
{
....
}
I can pass parameters to myfun from code behind of MyControl.ascx like:
string script2 = String.Format("myfun({0},{1})", param1, param2);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "initialize control", script2, true);
Is it possible to call this javascript function from MyPage.aspx?