Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > "Including" multiple files?

Reply
Thread Tools

"Including" multiple files?

 
 
farmer
Guest
Posts: n/a
 
      08-02-2005
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~

 
Reply With Quote
 
 
 
 
Lucas Tam
Guest
Posts: n/a
 
      08-02-2005
"farmer" <(E-Mail Removed)> 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 ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
 
 
 
farmer
Guest
Posts: n/a
 
      08-02-2005
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.

 
Reply With Quote
 
farmer
Guest
Posts: n/a
 
      08-02-2005
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?

 
Reply With Quote
 
Lucas Tam
Guest
Posts: n/a
 
      08-02-2005
"farmer" <(E-Mail Removed)> 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 ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
farmer
Guest
Posts: n/a
 
      08-02-2005
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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple ISPs and Multiple IP Ranges from Each ISP Chennak Cisco 10 06-08-2005 09:29 PM
IP Address Scheme for Multiple DMZs on Multiple PIXs Scotchy Cisco 2 10-07-2004 03:35 PM
Preventing multiple form submissions (multiple postbacks) Diane Selby ASP .Net 4 06-25-2004 09:50 PM
multiple dropdown lists = multiple data readers??? Andrew Kidd ASP .Net 3 04-22-2004 03:23 PM
Re: One solution containing multiple projects and multiple hosts Stephen Miller ASP .Net 0 06-24-2003 12:55 PM



Advertisments