Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > custom functions in global.asax

Reply
Thread Tools

custom functions in global.asax

 
 
Guest
Posts: n/a
 
      07-24-2005
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!


 
Reply With Quote
 
 
 
 
Robbe Morris [C# MVP]
Guest
Posts: n/a
 
      07-24-2005
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



<(E-Mail Removed)> wrote in message
news:e9OTmw%(E-Mail Removed)...
> 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!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Controls: Import a custom namespace and use its functions within user ASP .Net 1 07-19-2007 11:03 AM
Shared functions vs Non-Shared Functions tshad ASP .Net 11 05-27-2005 05:53 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM
Help! Passing Templates functions to template functions ILLOGIC C++ 1 06-01-2004 10:51 PM
Exportable class functions as stand alone functions to .DLL or .SO Timothy Wong C++ 3 05-20-2004 01:44 PM



Advertisments