Calling javascript from code behind

被刻印的时光 ゝ 提交于 2019-11-26 23:20:18

Assuming that the pre-conditions are true. You need to pass an additional parameter to the RegisterClientStartupScript method call to indicate that scriptTags need to be added.

Page.ClientScript.RegisterStartupScript(this.GetType(), "openCredentials", string.Format("radopen('Services.aspx?clientId={0}, Window_Services')", openCredentialsWindow_ClientId.ToString()),true);

When you view the source, after page load, is this code actually rendered into the source? Can you set a breakpoint at the this.Page.ClientScript...-line, to verify that both conditions before it are actually met?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!