unable to use <%@ import Namespace="System.Windows.Forms" %>
-
Hi, i use this code for web development and create message box: <%@ Control Language="C#" Src="nsoftwareAS2.cs"%> <%@ import Namespace="nsoftwareAS2" %> <%@ import Namespace="System" %> <%@ import Namespace="System.Windows.Forms" %> but it shows an error message when i tried to run the site: CS0234: The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?) How to fix it? MY
-
Hi, i use this code for web development and create message box: <%@ Control Language="C#" Src="nsoftwareAS2.cs"%> <%@ import Namespace="nsoftwareAS2" %> <%@ import Namespace="System" %> <%@ import Namespace="System.Windows.Forms" %> but it shows an error message when i tried to run the site: CS0234: The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?) How to fix it? MY
You are writing an ASP.Net application which CANNOT use the System.Windows namespace. To create a messagebox you can simply use javascript. Here is an example: StringBuilder str = new StringBuilder(); str.Append(""); str.Append("alert('Your Message Here')"); str.Append(""); RegisterStartupScript("Msg",str.ToString()); Hope that helps. Scott Stocker
-
You are writing an ASP.Net application which CANNOT use the System.Windows namespace. To create a messagebox you can simply use javascript. Here is an example: StringBuilder str = new StringBuilder(); str.Append(""); str.Append("alert('Your Message Here')"); str.Append(""); RegisterStartupScript("Msg",str.ToString()); Hope that helps. Scott Stocker
-
You are writing an ASP.Net application which CANNOT use the System.Windows namespace. To create a messagebox you can simply use javascript. Here is an example: StringBuilder str = new StringBuilder(); str.Append(""); str.Append("alert('Your Message Here')"); str.Append(""); RegisterStartupScript("Msg",str.ToString()); Hope that helps. Scott Stocker
I tried use your code and it gave me error message: CS1010: Newline in constant Source Error: Line 185: str.Append(""); I think the error came because I tried to use it inside my C# script: if (Common.RemoveSpecialCharacters(txtOrg.Text).Equals("")) { StringBuilder str = new StringBuilder(); str.Append(""); str.Append("alert('Please enter a valid organization name.')"); str.Append(""); RegisterStartupScript("Msg",str.ToString()); //lError.Text = "Please enter a valid organization name."; //return; } Any more help please? Thanks MY