Click here to Skip to main content
15,888,037 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
What i can use in webapplication lik we use MessegeBox.show()in windows application. othr thn alert,ok and cancel.... :omg:
Posted
Updated 6-Jan-10 20:05pm
v2

MessageBox method is a client side method, but a web application runs on the server. This is why it seems to work when you are locally running it (as your "server" is actually your local machine), but doesn't work when you run it on your server.

Try using Alert if you want to pass them a message, or Confirm if you want them to answer OK or Cancel. Do this by adding an onclick event to your button in the page load event.
 
Share this answer
 
There are 3 types of javascript Dialog available:

1. alert : which have only OK button in it.
2. confirm : which has Ok and Cancel
3. prompt : which has a textbox and OK /Cancel

Other than that, if you want any other message, you need to do it using HTML. Place a absolute position div over the document with exact design as alert.

:)
 
Share this answer
 
I would suggest you buy a VERY basic book on ASP.NET and read it before you go any further. You've plainly not done a course, so I assume that you're teaching yourself, and not writing code anyone will ever use.

Any winforms methods will show on the server only. Any C# code, by definition, runs on the server. These are basics of web development. Your browser knows how to display HTML and run javascript. Injecting javascript into the page with RegisterClientScriptBlock is how to get a popup to occur on the client side, after a postback.
 
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