我试图在提交表单后向用户显示一条消息,并希望返回我从消息中的数据库获得的 id,如下所示
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 功能。
最佳答案
删除<script>
标签和请尝试下面的代码
int reqid = come from database;
string scrp = "alert('your request submitted with number " + reqid.ToString() + " successfully !');";
ScriptManager.RegisterStartupScript(this , this.GetType(), "alert", scrp , true);
关于javascript - 脚本管理器在 ASP.NET 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32736609/