Code library

  • Thread starter Thread starter John
  • Start date Start date
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
 
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.
 
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.
 
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
 
Back
Top