在我的 .NET 网站上包含类文件和结构定义的正确方法是什么?
我在 .NET 中构建网站,而不使用 Visual Studio。
虚拟包含是包含我的类定义文件的正确方法吗?
例如,我的页面的前几行如下所示:
<!--#include file="classDefinition.aspx"-->
<!--#include file="anotherClassDefinition.aspx"-->
<script language="VB" runat="server">
'page load sub, etc
在 classDefinition.aspx 中,我在类外部定义了一个结构。 classDefinition.aspx 的前几行如下所示:
<script language="VB" runat="server">
Structure loginInfo
public loginID as string
public somethingElse as string
public permissions as hashtable
End structure
当我尝试在 anotherClassDefinition.aspx 中将私有成员声明为 loginInfo 时,出现类型未定义错误。为什么会发生这种情况?
I build sites in .NET without using Visual Studio.
Are virtual includes the right way to include my class definition files?
For example this is what the first few lines of my page look like:
<!--#include file="classDefinition.aspx"-->
<!--#include file="anotherClassDefinition.aspx"-->
<script language="VB" runat="server">
'page load sub, etc
In classDefinition.aspx, I have defined a structure outside of the class. The first few lines of classDefinition.aspx look like this:
<script language="VB" runat="server">
Structure loginInfo
public loginID as string
public somethingElse as string
public permissions as hashtable
End structure
I am getting type not defined errors when I try to declare a private member as loginInfo in anotherClassDefinition.aspx. Why is this happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在
App_Code
目录中创建普通的.vb
文件。您不需要在任何地方包含任何内容。
You should create ordinary
.vb
files in theApp_Code
directory.You don't need to include anything, anywhere.