在我的网页中用MessageBox函数提示:错误 命名空间“System”中不存在类型或命名空间名称“Windows”(是缺少程序集引用吗?) F:\myfile\myweb\gms_web\out_make.aspx.cs using System.Windows.Forms;
......
public void loadfile()
{
.............
MessageBox.Show("内容:\n\n输入项不能为空", "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);}
......
public void loadfile()
{
.............
MessageBox.Show("内容:\n\n输入项不能为空", "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);}
客户端安装。net框架,行吗?
欢迎使用 CSDN 小秘书
http://blog.csdn.net/whowhen21
**********************************************[/align]
晕,没看到lz是用在web上的,无视我之前的说法吧,抱歉,呵呵。
1.在菜单中找到“添加引用”选项,将System.Windows.Forms添加到工程里面;
2.//引用using System.Windows.Forms
即可使用了
MessageBox.Show("内容:\n\n输入项不能为空", "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
同时也可以用如下方法实现弹出对话框:
Page.RegisterStartupScript("", "<script>alert('输入项不能为空,请查看!')</script>");