473,758 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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
5 1787
"farmer" <sd******@sina. com> wrote in news:1122954013 .405163.91040
@z14g2000cwz.go oglegroups.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********@rog ers.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.go oglegroups.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********@rog ers.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
5124
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is relative NOT to the immediate script that is including it, but is relative to the top-level calling script. In practice, this means that you have to constantly worry and adjust paths in includes, based on the startup scripts that call these...
39
2416
by: TonyJeffs | last post by:
Great book - I like the way that unlike other books, AC++ explains as much as possible about every piece of code discussed, so I'm not left thinking, "well...OK... I get line 12, but I wonder what the rest of it means...". Still, I have some questions, that are frustrating me:- Grateful for any comments. 1. What is the difference between #include <iostream> // (or any include file) which is used in this
4
2292
by: bibsoconner | last post by:
Hi, I hope someone can please help me. I'm having a lot of trouble with schema files in .NET. I have produced a very simple example that uses "include" to include other schema files. It all works with SPY, but when I pick "Validate Schema" from the .NET 2003 menu, it fails with message: "Type XType is not declared." As I hinted at in my subject line, I suspect that it has to do with including another schema multiple times.
3
2097
by: Serious_Practitioner | last post by:
Good day, and thank you in advance for any assistance you can provide. I have a table in an Access 2000 .mdb file, and I've run into something odd and insolvable, at least for me. The database is for membership information. This particular table, called tblMembershipInfo, has fields/columns as follows - fldMemNum - Member Number fldActionDate - The date when the entry was made in that row - Data type is Date/Time, no format specified
15
2484
by: David | last post by:
is there some way to make a file (.cs) containing some common C# code classes being loaded on every .aspx page in my web without me having to declare it every time? Something in the config file perhaps? since I have these classes that will be used on every page, I want them to be like a "cloud hovering over my web" whatever page the user is browsing...
2
7154
by: NewToCPP | last post by:
I am having some trouble including "iostream" "fstream" to my code. I tried the following ways and base times it did not work. What is the problem? test.cc: ======= ..... #include <iostream.h> #include <fstream.h>
1
6508
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
11
1656
by: cokofreedom | last post by:
First off let me state that I really enjoy using Python. I am a 3rd year student and have been using python for 3 months, (thanks to trac!). I do not consider myself an experienced or clever programmer, but I am able to get by. Something I love about Python is that almost everything you do can be written in pseudo code then carried across into Python without a great- deal of difference. But reading through the warts and reading about...
0
9492
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10076
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8744
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7287
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3832
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3402
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2702
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.