asp.net中使用messagebox怎么提示不存在?

来源:百度知道 编辑:UC知道 时间:2024/09/25 02:33:43
我在asp.net中使用的一个messagebox.show提示框
protected void Button1_Click(object sender, EventArgs e)
{
MessageBox.show("welcome" + TextBox1.Text + "to edit and continue.");
提示上下文中没有messagebox,这是什么原因?请教高手,谢谢!
}

有些.NET里WIN FROM(也就是桌面程序)时用的命名空间,在WEB程序里是不能使用的。asp.net中你可以用这个代替MessageBox.show。
你这样写
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>alert('welcome to " + TextBox1.Text + " edit and continue.')</script>");
}