Click here to Skip to main content
15,897,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to display message in Message Box in Asp dot net using c# ?
Posted
Comments
Varun Sareen 22-Feb-12 23:33pm    
Please accept the solution which helped you out.

Thanks

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

C#
System.Windows.Form.MessageBox.Show()


and JS alert will be like
Reponse.Write("alert('Hello')");
 
Share this answer
 
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://stackoverflow.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net-web-application[^]

Always do some google search first.

Thanks
 
Share this answer
 
v2
JavaScript and jQuery is batter option

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

myStringVariable = "Welcome";


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



and have a look at this:

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900