Click here to Skip to main content
14,326,421 members
Rate this:
Please Sign up or sign in to vote.
See more:
in the namespace not have messagebox.show
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

Nup, using messagebox.show in Asp.net is a bad idea. you can use javascript to do the same.
http://www.w3schools.com/js/js_popup.asp[^]
http://dhtmlx.com/docs/products/dhtmlxMessage/index.shtml[^]

If you want to show messagebox from code behind then you can use ScriptManager Class[^] to register javascript with page. Try this
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Myscript1", @"alert('Hi am a alert box');", true);



--Amit
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Problem

Message Box is for Windows Forms. You can still use it, but that will not reflect at client side.

Solution

So, you need to use javaScript alert or confirm box.
Rate this:
Please Sign up or sign in to vote.

Solution 3

Simplest way:

Response.Write("<script type='text/javascript'>");
Response.Write("alert('There does not exist any simpler alert then this.');");
Response.Write("</script>");


Regards.. :laugh:
   
v2

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100