是不是只有组件类才能在ASPX中调用?
出错信息:CS0234: 类型或命名空间名称“f1”在类或命名空间“intro2”中不存在(是否缺少程序集引用?)代码如下:
页面文件:form1.aspx
<%
Response.ContentType = "text/plain";
Response.Write( intro2.f1() );
%>类文件:Class1.cs
using System;namespace intro2{
public class Class1{
public Class1(){}
public static System.String f1() {
return "hello!";
}
}
}
出错信息:CS0234: 类型或命名空间名称“f1”在类或命名空间“intro2”中不存在(是否缺少程序集引用?)代码如下:
页面文件:form1.aspx
<%
Response.ContentType = "text/plain";
Response.Write( intro2.f1() );
%>类文件:Class1.cs
using System;namespace intro2{
public class Class1{
public Class1(){}
public static System.String f1() {
return "hello!";
}
}
}
而且如果是另外个项目,要引用一下