Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use messagebox.show("") in my web app
but gives me this error:
Compiler Error Message: CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

Source Error:


Line 8: using System.Configuration;
Line 9: using System.Data;
Line 10: using System.Windows.Forms;
Line 11:
Line 12: namespace Csharp
Posted
Comments
Fredrik Bornander 7-Dec-12 9:47am    
You don't want to do that. It's a bad idea.

1 solution

The web will not support showing a messagbox this way. The C# code runs on the server and generates HTML which is sent to the client and then the browser renders the HTML. If you want to show a message to the user you need to use JavaScripts alert[^] or use a jQuery plugin.
 
Share this answer
 
Comments
lovitaxxxx 7-Dec-12 9:55am    
i used this and works perfectly
Response.Write(@"<script language='javascript'>alert('First Record') </script>");
ZurdoDev 7-Dec-12 9:55am    
Yes, that will work. If it will ever be more complex than that you'll want to create a JavaScript file and functions but for simple things, that will work fine.

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