469,954 Members | 1,659 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

custom functions in global.asax

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!
Nov 19 '05 #1
1 1984
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

<pa***@community.nospam> wrote in message
news:e9***************@TK2MSFTNGP15.phx.gbl...
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!

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by David P. Donahue | last post: by
reply views Thread by Ranv | last post: by
3 posts views Thread by Mr Newbie | last post: by
reply views Thread by gilly3 | last post: by
8 posts views Thread by Rob T | last post: by
3 posts views Thread by David | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.