C#使用消息框_c

2020-02-27 其他范文 下载本文

C#使用消息框由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“c”。

C#使用消息框

c#如何在web上弹出消息框,这个问题几乎每天都有人问

Response.Write(“javascript:alert('hahahah!')”);

或:

.Attributes.Add(“onclike”,“returnconfirm('areyousure?')”);----------------

Page.RegisterStartupScript(“”,“alert('添加数据成功!')”);

----------------

现在知道了,只要Page.RegisterStartupScript(“”,“alert('添加数据成功!')”);中把alert改为confirm就行了。

----------------

麻烦一点你可以加引用System.Windows.Forms.dll

命名空间:usingSystem.Windows.Forms.MeageBox;

之后使用MeageBox.Show();

具体你可以查一下MeageBox.Show

MeageBox.Show(“Youmustenteraname.”,“NameEntryError”,MeageBoxButtons.OK,MeageBoxIcon.Exclamation);

----------------

Button1.Attributes.Add(“onclike”,“returnconfirm('areyousure?')”);

button.Attributes.Add(“onclick”,“returnconfirm('文本');”);

----------------

Reponse.Write(“window.alert('消息')”);

----------------

《C#使用消息框.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
C#使用消息框
点击下载文档
相关专题 c 消息 c 消息
[其他范文]相关推荐
    [其他范文]热门文章
      下载全文