Code library

J

John

Hi

Is there a way to have code modules that all pages in a web app can access
kinda like a code library?

Thanks

Regards
 
P

Peter Bucher [MVP]

Hello John
Is there a way to have code modules that all pages in a web app can access
kinda like a code library?
Jep

Make a (static) Class with static Methods

-> Reference to DLL
-> Using Statement

User your Class like:

this.lblTest.Text = Tools.DoSomethingWith(this.lblTest.Text);

Surely you can also use instance Helper classes, that depents on
what you want to reach.
 
J

Joe Fawcett

Munna said:
Hi

"Is there a way to have code modules that all pages in a web app can
access
kinda like a code library? "

yes you can have...

just add a class to your project and use in codebehind file of the
pages...

you can make single to tone or static class... what ever you like...

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
What I normally do is to add a class file to the App_Code directory and
include method sin it as I go along.
When the site is complete I remove anything from the class file that looks
reusable to a separate class library project for use in other apps.
 
H

Habiburahman Khalid

Hi,
Yea you can use the App_Code directory, just place any class you want in
that directory it will be accessable from all pages

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,938
Members
47,474
Latest member
VivianStuk

Latest Threads

Top