在.cs中调用javascript的方法

如果没有Ajax,cs中运行某段js代码方式可以是:
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>InitScript();</script>");


如果页面中使用了Ajax ,则上述代码即使执行也无效果。
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "loadTiny", "showCreateSpecialOffer();", true);
第四个参数里包含了<script></script>标签,此处则为false,否则为true。

posted on 2012-09-17 11:30  魔GUI  阅读(325)  评论(0编辑  收藏  举报

导航