Click here to Skip to main content
15,888,064 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to show message box in C# in web application
Posted

MessageBox is only available in Window Applicaitons. In ASP.NET, you cannot use the MessageBox class or MsgBox function like you can in a Window Applicaitons, but you can emulate this functionality by streaming out a javascript alert instruction like this:

C#
Response.Write(@"<script language='javascript'>alert('This is my Message')</script>");
 
Share this answer
 
Comments
VJ Reddy 8-Jun-12 5:17am    
Good answer. 5!
Manas Bhardwaj 8-Jun-12 5:19am    
cheers :)
1811421 8-Jun-12 6:47am    
it is not working
Hi,
Use javascript alert to display Message box in asp.net
XML
Response.Write("<script>alert('Hello')</script>");
 
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