我想在c#asp.net中使用OK按钮添加/显示一些消息,而不使用windows.forms名称空间。
答案 0 :(得分:11)
使用:
string display = "Pop-up!";
ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + display + "');", true);
how to show alert box after successful insert using C#
Buttons, Message Box, and Confirm Box in ASP.NET 3.5
答案 1 :(得分:0)
Ext JS 得到了一些好的消息框脚本,看看这个,它会对你有所帮助 Ext JS MessageBox Dialogs
答案 2 :(得分:0)
public void Message(String msg)
{
string script = "window.onload = function(){ alert('";
script += msg;
script += "');";
script += "window.location = '";
script += "'; }";
ClientScript.RegisterStartupScript(this.GetType(), "Redirect", script, true);
}