且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用VB和C#在Asp点网中的消息框中显示消息

更新时间:2023-02-08 15:46:37

我认为您想显示Window的消息框,它''会像这样

I think you want to show Window''s Message Box,it''ll be like this

System.Windows.Form.MessageBox.Show()



和JS警报会像
Reponse.Write("alert(" Hello)");



and JS alert will be like
Reponse.Write("alert(''Hello'')");


亲爱的朋友,

请通过此链接解决您的问题:-

ASP.Net不允许您像在C#Windows应用程序中一样显示消息框.在此处或Ajax中使用JavaScript警报框.

http://***.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net-web-application [
Dear Friend,

Please follow this link for your problem:-

ASP.Net doesn''t allow you to show message boxes like in C# windows application. Use javascript alert boxes here or ajax.

http://***.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net-web-application[^]

Always do some google search first.

Thanks


JavaScript和jQuery是连击选项

但是在c#中尝试一下
JavaScript and jQuery is batter option

but try this in c#
string myStringVariable = string.Empty;

myStringVariable = "Welcome";


ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);




看看这个:

一个简单的ASP.NET服务器控件:消息框&确认框 [ ^ ]




and have a look at this:

A Simple ASP.NET Server Control: Message Box & Confirmation Box[^]