以下为HelloWorld.aspx文件中的内容。<%@ Page Language="C#" Debug="true" %>
<script runat="server">
void ShowLineage()
{
Response.Write("Check out the family tree: <br> <br>");
Response.Write(this.GetType().ToString());
Response.Write(" which derives from: <br> ");
Response.Write(this.GetType().BaseType.ToString());
Response.Write(" which derives from: <br> ");
Response.Write(this.GetType().BaseType.BaseType.ToString());
Response.Write(" which derives from: <br> ");
Response.Write(
this.GetType().BaseType.BaseType.BaseType.ToString());
Response.Write(" which derives from: <br> ");
Response.Write(
this.GetType().BaseType.BaseType.BaseType.BaseType.ToString());
}
</script>
<html>
<body>
<h1>Hello World!!!</h1>
<%
// This block will execute in the Render_Control
method
ShowLineage();
%>
</body>
</html>
报错
Compiler Error Message: CS1528: Expected ; or = (cannot specify constructor arguments in declaration)Source Error: Line 23: // This block will execute in the Render_Control
Line 24: method
Line 25: ShowLineage();
Line 26: %>
Line 27: </body>
Source File: d:\ASP.NET\HelloWorld3.aspx Line: 25
请问这问题如何解决 是什么原因?
<script runat="server">
void ShowLineage()
{
Response.Write("Check out the family tree: <br> <br>");
Response.Write(this.GetType().ToString());
Response.Write(" which derives from: <br> ");
Response.Write(this.GetType().BaseType.ToString());
Response.Write(" which derives from: <br> ");
Response.Write(this.GetType().BaseType.BaseType.ToString());
Response.Write(" which derives from: <br> ");
Response.Write(
this.GetType().BaseType.BaseType.BaseType.ToString());
Response.Write(" which derives from: <br> ");
Response.Write(
this.GetType().BaseType.BaseType.BaseType.BaseType.ToString());
}
</script>
<html>
<body>
<h1>Hello World!!!</h1>
<%
// This block will execute in the Render_Control
method
ShowLineage();
%>
</body>
</html>
报错
Compiler Error Message: CS1528: Expected ; or = (cannot specify constructor arguments in declaration)Source Error: Line 23: // This block will execute in the Render_Control
Line 24: method
Line 25: ShowLineage();
Line 26: %>
Line 27: </body>
Source File: d:\ASP.NET\HelloWorld3.aspx Line: 25
请问这问题如何解决 是什么原因?
method
放成一行,或者直接删除了