C#使用消息框_c
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('消息')”);
----------------