How to fire JS from code behind of a UserControl by an event

梦想与她 提交于 2019-12-02 04:59:08

there may be below possible reasons try to change these and check it works or not

 1). ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('hi!')", true);//no need to use javascript with alert when bool set to true

 2). ScriptManager.RegisterStartupScript(page, page.GetType(), "msg", "alert('hi!')", true);

 3). ClientScript.RegisterClientScriptBlock(GetType(), "sas", "<script> alert('hi!');</script>", true);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!