脚本管理器不在asp.net中工作

时间:2015-09-23 10:05:16

标签: javascript asp.net ajax scriptmanager

我试图在提交表单后向用户显示一条消息,并希望返回我从db中获取的id,如bellow

int reqid = come from database;

string scrp = "<script>alert('your request submitted with number " + reqid.ToString() + " successfully !');'</script>";

ScriptManager.RegisterStartupScript(this , GetType(), "alert", scrp , true);

我不知道脚本无法正常工作的原因。

我在我的页面中使用了ajax功能。

1 个答案:

答案 0 :(得分:1)

删除<script>代码和Plz尝试下面的代码

int reqid = come from database;

string scrp = "alert('your request submitted with number " + reqid.ToString() + " successfully !');";

ScriptManager.RegisterStartupScript(this , this.GetType(), "alert", scrp , true);