网页中用Message,还需要using语句吗?为什么会出错呢?
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication1.WebForm1" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>我的第一个页面</title>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language=C# runat=server>
void SubmitBtn_Click(Object sender,EventArgs e)
{
Message.Text="hello:"+name.Text+",your choies is:"+d.SelectedItem;
}
</script>
</HEAD>
<body>
<form action="WebForm1.aspx" method="post" runat="server">
<h3>姓名:<asp:TextBox ID="name" Runat="server" />
类别:<asp:DropDownList ID="d" Runat="server">
<asp:ListItem>one</asp:ListItem>
<asp:ListItem>two</asp:ListItem>
<asp:ListItem>three</asp:ListItem>
</asp:DropDownList>
</h3>
<asp:Button Text="sure" OnClick="SubmitBtn_Click" Runat="server" />
</form>
</body>
</HTML>
以上是源代码,错误行在Message.Text="hello:"+name.……
错误提示是找不到类型或命名空间名称“Message”(是否缺少 using 指令或程序集引用?)
帮我看看哪儿错了,好吗,我刚接触asp.net。谢谢各位呀。