Question : Global Functions ...global.asax?

Hi

Coming from PHP background ...I am used to having a 'functions' include file that I can put useful functions that I use application wide ... I simply call include('path/functions.php') at the top of any php page and I can access the functions globally.

In .NET, I've read a few different ways of doing something similar ...some ppl mention a global.asax file and say that you can just put functions (subs) in there and you can then access them globally ...is this a good idea? (reason I ask is I've also read it's not supposed to be used in this way and is meant for higher level application events like application_start and end etc) ...and if it's not bad to do this, HOW do I do this? :-) ie.

Other ppl mention using a functions class ...so just create a file like that:

Class Functions
    Sub WhatEver ...
    End Sub
End Class

but then how do I include that in my files and gain access to these functions? ie. there's no 'include' ability in .NET as such is there?

I'm not too worried about following OO guidelines (in case I'm at risk of breaking any)  ...I just want to get the job done ...and having a global functions file will make things easier :)

Thanks

Answer : Global Functions ...global.asax?

you can do so by adding this line of code to Page_Load event

'' Add the event handler to an image button
  AddHandler btnExport1.Click, AddressOf ExportToExcel

then you won't need onclick in the ImageButton:

:ImageButton>
Random Solutions  
 
programming4us programming4us