467,877 Members | 1,257 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

"Including" multiple files?

I need "include" multiple classes from multiple files such as:
<%@ Page Language="C#" Debug="true" ValidateRequest="false"
Src="~/Auth/Pub/Auth.cs"%>
<%@ Page Language="C#" Debug="true" ValidateRequest="false"
Src="~/Edit/Item.cs"%>

But the compile says can't use more than one "@Page" directive.

Or,I need to "include" another class from a .cs into a currently .ascx
using:

<%@ Page Language="C#" Debug="true" ValidateRequest="false"
Src="~/Auth/Pub/Auth.cs"%>
<%@ Import namespace="Auth" %>

But I got:
Parser Error Message: The directive 'page' is unknown.

How can I do?Thx~

Nov 19 '05 #1
  • viewed: 1570
Share:
5 Replies
"farmer" <sd******@sina.com> wrote in news:1122954013.405163.91040
@z14g2000cwz.googlegroups.com:
I need "include" multiple classes from multiple files such as:
<%@ Page Language="C#" Debug="true" ValidateRequest="false"
Src="~/Auth/Pub/Auth.cs"%>
<%@ Page Language="C#" Debug="true" ValidateRequest="false"
Src="~/Edit/Item.cs"%>

But the compile says can't use more than one "@Page" directive.

Or,I need to "include" another class from a .cs into a currently .ascx
using:

<%@ Page Language="C#" Debug="true" ValidateRequest="false"
Src="~/Auth/Pub/Auth.cs"%>
<%@ Import namespace="Auth" %>

But I got:
Parser Error Message: The directive 'page' is unknown.

There's no need to include files like that in .NET... Are you using
VS.NET? Just add the files to your project, and you can reference the
classes by name in code.
Or you can use User Controls to encapsulate stuff.

Or you can use MasterPages to build page templates.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
By the way,I don't like mess all thing into App_Code\ Folder.And as you
can see, I am using ASP.NET 2.0.

Nov 19 '05 #3
Thank you,Dear Tam!

I am not using VS.NET IDE just now. Would you mind show me line text
that how that looks like in source code?

Nov 19 '05 #4
"farmer" <sd******@sina.com> wrote in news:1122954743.061157.91760
@g14g2000cwa.googlegroups.com:
Thank you,Dear Tam!

I am not using VS.NET IDE just now. Would you mind show me line text
that how that looks like in source code?

In VS.NET... it does all the linking for you.

Say in Edit.vb it contains a class called Edit. User.vb contains a class
called User. These files can be anywhere within the project (i.e. within
their own subdirectory... or within their own DLL. If you're using a
DLL, then you'll need to add a reference).

In code, I would go:

Dim MyUser as User = New User
Dim MyEditor as Editor = New Editor

Unfortunately I don't know how VS.NET links the files all together...
but I'm sure there is a non-editor equivalent.

BTW, have you tried using the free ASP.NET editor on http://www.asp.net?
Perhaps that will help you manage your code? : )

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #5
I understand that. VS.NET must put some stuff into "App_Code\" folder
for sharing purpose.

Well,maybe this is the only way for my purpose.

Thank you sooo much!

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

43 posts views Thread by steve | last post: by
39 posts views Thread by TonyJeffs | last post: by
3 posts views Thread by Serious_Practitioner | last post: by
15 posts views Thread by David | last post: by
2 posts views Thread by NewToCPP | last post: by
11 posts views Thread by cokofreedom | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.