我正在开发一个网站,在其中我试图通过ClientScript.RegisterStartUpScript显示消息。
已成功显示此信息:
ClientScript.RegisterStartupScript(this.GetType(), "myalert",
"alert('All questions have been visited !');", true);尽管它给出了一个带有复选框的消息,上面写着“阻止这个页面创建额外的对话框”,但.I并没有选中这个复选框。在我的后台代码中,我有这样的情况:
if (lblUnConfirmedQuestions.Text=="0")
{
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "msg",
"alert( 'Please attempt all the questions !')",true);
}这本应在稍后显示,但它没有出现。
在互联网上,我发现一个建议,删除单引号的ClientScript消息,我删除了他们,但仍然没有成功的achieved.What我应该做显示第二个客户端脚本消息?
发布于 2014-08-26 21:57:40
"Please attempt all the questions !"只是文本。
您需要类似这样的内容才能显示警报消息。
ClientScript.RegisterStartupScript(this.GetType(),
"msg", "alert('Please attempt all the questions !');",true); https://stackoverflow.com/questions/25507581
复制相似问题