custom functions in global.asax

G

Guest

Hi all,

Is it possible to have custom function/subroutines in global.asax? e.g.
DoMyWork(i as integer) etc etc. If yes, how can I access this code in my
..aspx pages? I know I can put this into a seperate dll in the bin directory,
but to keep it simple global.asax would be nice too..

TIA!
 
R

Robbe Morris [C# MVP]

Yes, you can make them public static in global.asax.

However, this is not a good idea. It makes it
much more of a hassle if you choose to reuse that
method in another web application or in a different
environment such as a .NET Windows Forms
application or .NET Compact Framework application.

You really should stay consistant with your OOP layers
and not get lazy by just throwing code in your global.asax
all willy nilly.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top