Public Functions

  • Thread starter Thread starter Duane
  • Start date Start date
D

Duane

Can anyone tell me what is the standard practice for
creating functions that can be used globally by a asp.net
application. Should we put them in a class or just
create another webform and reference it like an object
accessing the functions as methods? Any insight would be
helpful.

Thanks
 
A Class Library sounds like what you're looking for.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi Duane,

I've found it helpful to create a class that contains all of these methods.
The methods are static (c#) / shared (vb), which means you dont have to
create an instance of the class.

Example (VB):
Public Class Website
Private Sub New () 'not to allow an instance to be created
End Sub
Public Shared Function MyFunction() As String
End Function
End Public

.... and to access it, simply put it in your BIN folder, and you can go
Website.MyFunction.

Alex Papadimoulis
 

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

Back
Top