Reputation: 588
I am trying to code for pop up message box for displaying message for successful record insertion in C#.net
Error :
The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
Code :
global::System.Windows.Forms.MessageBox.Show("Test");
Upvotes: 10
Views: 54206
Reputation: 295
Incredibly I got this error when one of my class libraries has 'System' in its own namespace. MyCompany.Foo.Bar.Client.System as my assembly namespace must have cause a clash somewhere. Removing the 'System' from my namespace solved the problem.
Upvotes: 2
Reputation: 111
I am using Visual Studio 2012, Framework 4.0 for windows application. I was also getting the following message: 'the type or namespace 'windows' does not exist'
To fix this problem, I added reference to Windows.Forms.dll. After that I can display message box using the following code
System.Windows.Forms.MessageBox.Show("Completed successfully");
Upvotes: 0
Reputation: 1642
If you are using MS Visual Studio:
P. S.: Additionally, I had to do the same with "System.Drawing" for everything to work correctly in my first GUI Windows program.
Upvotes: 17
Reputation: 45490
You are not missing any DLL , It seems like you are using the wrong type of project.
Upvotes: 7
Reputation: 1038810
global::System.Windows.Forms.MessageBox.Show("Test");
in an ASP.NET MVC application? And where did you expect this message box to pop out?
In an ASP.NET MVC application you could use client side javascript to show message boxes.
For example inside your view you could put the following:
<script type="text/javascript">
alert('Test');
</script>
And when you navigate to the corresponding controller action the user will be greeted with the message box.
Upvotes: 10