我一直在查看RegisterClientScriptBlock对象,它运行了一些JavaScript代码,并且一直试图使用它。
我现在有
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type=\"text/javascript\">function clearStorage() {alert('here');localStorage.clear();}</script>", false);我希望当代码被击中时,警报会弹出,但它永远不会弹出,参数是正确的,还是我走错了路?
谢谢
克里斯
发布于 2015-02-19 14:28:00
试试这个:
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type=\"text/javascript\">function clearStorage() {alert('here');localStorage.clear();} clearStorage();</script>", false);https://stackoverflow.com/questions/28608659
复制相似问题