473,804 Members | 3,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reference another file from code-behind page...?

Hey,

I'm sure this is an easy question for most.

I would like to create a class with a bunch of "library" functions...
But I'm not sure how I would configure it so that I can call functions
from one "code" file from another "code behind" file....

Page1.aspx ---Page1.aspx.cs ---globallibrary.c s

Is this possible?

Thanks!

Jun 9 '07 #1
7 2251
On Jun 9, 3:32 pm, Bodyboarder20 <ShieldsJa...@g mail.comwrote:
Hey,

I'm sure this is an easy question for most.

I would like to create a class with a bunch of "library" functions...
But I'm not sure how I would configure it so that I can call functions
from one "code" file from another "code behind" file....

Page1.aspx ---Page1.aspx.cs ---globallibrary.c s

Is this possible?

Thanks!
globallibrary_c lass_name.publi c_static_functi on_name();

public class globallibrary_c lass_name
{
public static string public_static_f unction_name()
{
return "hello";
}
}

Jun 9 '07 #2
re:
!I would like to create a class with a bunch of "library" functions...
!But I'm not sure how I would configure it so that I can call functions
!from one "code" file from another "code behind" file....

Place globallibrary.c s in the App_Code directory.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"Bodyboarde r20" <Sh**********@g mail.comwrote in message
news:11******** *************@g 4g2000hsf.googl egroups.com...
Hey,

I'm sure this is an easy question for most.

I would like to create a class with a bunch of "library" functions...
But I'm not sure how I would configure it so that I can call functions
from one "code" file from another "code behind" file....

Page1.aspx ---Page1.aspx.cs ---globallibrary.c s

Is this possible?

Thanks!

Jun 9 '07 #3
Do I need to put any spacial tags at the top of the page1.aspx.cs file
to point it to the globallibrary.c s file?

Jun 9 '07 #4
Oh, btw... this is .NET 1.1 ( I know, my work is nuts )

!from one "code" file from another "code behind" file....

Place globallibrary.c s in the App_Code directory.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
=============== =============== ========"Bodybo arder20" <ShieldsJa...@g mail.comwrote in message

news:11******** *************@g 4g2000hsf.googl egroups.com...
Hey,
I'm sure this is an easy question for most.
I would like to create a class with a bunch of "library" functions...
But I'm not sure how I would configure it so that I can call functions
from one "code" file from another "code behind" file....
Page1.aspx ---Page1.aspx.cs ---globallibrary.c s
Is this possible?
Thanks!- Hide quoted text -

- Show quoted text -

Jun 9 '07 #5
For ASP.NET 1,1, compile the code from the command-line,
and import/reference the resulting assembly.

Open a command window and make sure the
1.1 .Net Framework directory is in your system path, by running

PATH= %PATH% & C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 ;

Substitute the correct drive letter if you're booting from a different drive.

Also, if you have a non-standard Windows install,
replace "windows" with your custom-named install directory.

To compile a single source code file, use :

csc /t:library /out:globallibra ry.dll globallibrary.c s

To compile all .cs files in a directory to globallibrary.d ll ,
use : csc /t:library /out:globallibra ry.dll *.cs

If you need to reference a .Net Framework assembly or assemblies,
add them, separated by slashes :

csc /t:library /r:system.dll /r:system.data.d ll /out:globallibra ry.dll *.cs

Once you have compiled your assembly, place it in the /bin
directory of your application, and import your class Namespace in any aspx page:

<%@ Import Namespace="Your NameSpace" %>

If you're working with VS.NET, compile your assembly
as described and add a reference to it in your VS.NET project.

That will allow you to use Intellisense and get your
assembly's properties, methods, etc. when coding.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"Bodyboarde r20" <Sh**********@g mail.comwrote in message
news:11******** **************@ p47g2000hsd.goo glegroups.com.. .
Oh, btw... this is .NET 1.1 ( I know, my work is nuts )

!from one "code" file from another "code behind" file....

Place globallibrary.c s in the App_Code directory.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
=============== =============== ========"Bodybo arder20" <ShieldsJa...@g mail.comwrote in message

news:11******** *************@g 4g2000hsf.googl egroups.com...
Hey,
I'm sure this is an easy question for most.
I would like to create a class with a bunch of "library" functions...
But I'm not sure how I would configure it so that I can call functions
from one "code" file from another "code behind" file....
Page1.aspx ---Page1.aspx.cs ---globallibrary.c s
Is this possible?
Thanks!- Hide quoted text -

- Show quoted text -

Jun 9 '07 #6

Perfect solution!!!

Thanks so much!!!!!!!

Jun 9 '07 #7
re:
!Perfect solution!!!

Except that I fudged the path to the 1.1 Framework directory...

That should have been :

PATH= %PATH%;C:\WINDO WS\Microsoft.NE T\Framework\v1. 1.4322;

Sorry...

Other than that, everything stands...and you're quite welcome.

:-)


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"Bodyboarde r20" <Sh**********@g mail.comwrote in message
news:11******** **************@ n4g2000hsb.goog legroups.com...
>
Perfect solution!!!
Thanks so much!!!!!!!

Jun 9 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
20380
by: Pablo J Royo | last post by:
Hello: i have a function that reads a file as an argument and returns a reference to an object that contains some information obtained from the file: FData &ReadFile(string FilePath); But , for example, when the file doesnt exists, i should not return any reference to a bad constructed object, so i need something as a NULL reference object. I suppose i could return a pointer instead, but i have some code written with references which...
6
5625
by: trexim | last post by:
Hi, I am trying to create a Web Reference for CSTA using the URL http://www.ecma-international.org/standards/ecma-348/csta-wsdl/csta-wsdl-all-operations.wsdl Visual .Net complains that: " The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading
10
5504
by: PCHOME | last post by:
Hi! Would someone please help me thess C error(in gcc on Linux)? The compiler continues to give me: readLP.o: In function `Input_Problem': readLP.o(.text+0x0): multiple definition of `Input_Problem' main.o(.text+0x2f2): first defined here /usr/bin/ld: Warning: size of symbol `Input_Problem' changed from 172 to 185 in
3
4415
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
0
1391
balabaster
by: balabaster | last post by:
Hi all, I'm creating a class factory and a bunch of adapters to allow in house applications to communicate with mobile applications over different cellular networks. I've got my class factory and interface definition in a single assembly. The class factory will instantiate the correct adapter for communication with a mobile device at runtime. We're doing it this way because we won't know which cellular network we're communicating over...
0
10567
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
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
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
7613
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...
1
4291
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
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
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.