Click here to Skip to main content
13,141,576 members (28,793 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I want to use"") 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 7-Dec-12 3:11am
Fredrik Bornander 7-Dec-12 9:47am
You don't want to do that. It's a bad idea.

1 solution

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

Solution 1

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.
Annnaa 7-Dec-12 9:55am
i used this and works perfectly
Response.Write(@"<script language='javascript'>alert('First Record') </script>");
ryanb31 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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