出于某种原因,我在尝试测试计算机上的代码页时出现此错误。ASP.NET无效元素名称StartTag错误
它可能与错误的IIS安装有关,但我似乎无法找出问题所在。
我得到以下错误:
error on line 1 at column 2: StartTag: invalid element name
这里是我的Default.aspx:
<%@ Page Language="C#" %>
<html>
<head>
<title>Plating Trees</title>
<script runat=”server”>
protected void Page_Load(Object Source, EventArgs E)
{
/* Begin C# Code!*/
Tree tree1 = new Tree();
tree1.Grow(3);
tree1.Message();
}
</script>
</head>
<body>
<p><asp:label runat=”server” id=”Output” /></p>
</body>
</html>
Tree.cs:
/* A simple C# class! */
public class Tree
{
public int height = 0;
public void Grow(int h)
{
height += h;
}
public string Message()
{
Output.Text = "The height of tree1 is:<br/>” + tree1.height + feet";
}
}
哎呦,不能相信我没有意识到, , 谢谢! – Qcom 2010-09-11 05:59:14