出於某種原因,我在嘗試測試計算機上的代碼頁時出現此錯誤。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