【发布时间】:2011-09-17 05:50:43
【问题描述】:
如何在客户端页面中获得 OK 按钮消息框的响应。
ClientScript.RegisterStartupScript(this.GetType(), "My alert", "alert('" 你的时间已经结束了"');", true);
此代码以简单的方式运行,但没有得到任何响应。
【问题讨论】:
标签: javascript asp.net
如何在客户端页面中获得 OK 按钮消息框的响应。
ClientScript.RegisterStartupScript(this.GetType(), "My alert", "alert('" 你的时间已经结束了"');", true);
此代码以简单的方式运行,但没有得到任何响应。
【问题讨论】:
标签: javascript asp.net
您可以在下一行直接开始您的进一步活动。单击确定按钮后,它将返回到您的下一行。
//你的代码放在这里... //例如:-
ClientScript.RegisterStartupScript(this.GetType(), "My alert", "alert('" Your time has been finished "');", true);
System.Text.StringBuilder sbs = new System.Text.StringBuilder();
sbs.Append("<script language='javascript'>");
sbs.Append("window.location = 'http://www.google.com/'");//or whatever you want:-
sbs.Append("</script>");
Type tr = this.GetType();
ClientScript.RegisterClientScriptBlock(tr, "PopupScript2", sbs.ToString());
【讨论】: