Click here to Skip to main content
15,567,415 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# ?
Varun Sareen 22-Feb-12 23:33pm    
Please accept the solution which helped you out.


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


and JS alert will be like
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.[^]

Always do some google search first.

Share this answer
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);

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