Click here to Skip to main content
15,921,452 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hello friends,
I was trying to call javascript function in child page
I have written following JS function in contentholder
function CreateGridHeader(pnlGVForecast, GridView1, HeaderDiv) {
....
}


I bind this function in Page_load in following way
 protected void Page_Load(object sender, EventArgs e) {
ClientScript.RegisterStartupScript(this.GetType(), "CreateGridHeader", "<script>CreateGridHeader('pnlGVForecast', 'gvForecastSummary','HeaderDiv');</script>");
}


I tried to check the source code at runtime, what I found is the change in ID of controls
<br />
cphPage_pnlGVForecast for pnlGVForecast, cphPage_gvForecastSummary for gvForecastSummary<br />


i tried the following code too
ClientScript.RegisterStartupScript(this.GetType(), "CreateGridHeader", "<script>CreateGridHeader('cphPage_pnlGVForecast', 'cphPage_gvForecastSummary','HeaderDiv');</script>");


Still the javascript function is not getting called

Any solution??

Thanks in advance
Posted
Comments
ZurdoDev 2-May-12 10:43am    
Please clarify. Are you trying to call a function in an iframed page from the parent page?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900