Function Library

  • Thread starter Thread starter Chris Jackson
  • Start date Start date
C

Chris Jackson

In clasic asp you could have some include files that had all your common
functions in them so you could include them in your application by <!
Include ing them.


Ok - Im new to asp.net -
im wanting to construct a function library in asp.net - but i heard someone
in the list say that that is the older way of thinking - we are now to think
in OOP style and classes stuff.

Help - where on the web can i read about this type of method of including
classes into my asp.net pages...?

Thanks.
 
ASP.net pages ARE classes. New webforms are set to inherit from
System.Web.UI.Page. However you can create your own base page and have your
asp.net code behind classes inherit from that page. Your base page would
include common elements(UI)/functions used by the rest of your pages
(classes). I think you will find that you will not need as many generic
"helper functions" as you once wrote in an asp application as the .net
framework is rich w/ it's functionality. You can also create a class w/ a
private constructor w/ only static methods much the same way you use :
System.DateTime.Now :

This is a good guide on architecture for asp.net applications.
http://msdn.microsoft.com/practices/type/Patterns/default.asp

~PJ
 
Hello Chris,

I replied the question in another of your post. Just now I saw PJ's answer.
I am not sure of whether I misunderstand your questions before.

I agree with PJ that you could inherit a page to create an own page. The
points here is that what you want to reuse. If it is a function library,
such as email sending library, you could use a class library as I
mentioned. If you want to reuse a page, you could create a base page as PJ
suggested.

Please feel free to post if you have any more concerns.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
--------------------
!From: "Chris Jackson" <[email protected]>
!Subject: Function Library
!Date: Tue, 24 Jun 2003 14:30:44 -0500
!Lines: 16
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <[email protected]>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!NNTP-Posting-Host: 66.49.58.146.nw.nuvox.net 66.49.58.146
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:154567
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!In clasic asp you could have some include files that had all your common
!functions in them so you could include them in your application by <!
!Include ing them.
!
!
!Ok - Im new to asp.net -
!im wanting to construct a function library in asp.net - but i heard someone
!in the list say that that is the older way of thinking - we are now to
think
!in OOP style and classes stuff.
!
!Help - where on the web can i read about this type of method of including
!classes into my asp.net pages...?
!
!Thanks.
!
!
!
 
ASP is procedural in nature. Therefore, you used "function libraries" as you
describe it for storing commonly-used functions. As you have pointed out,
ASP.Net is object-oriented. This means that you use classes instead. A class
is basically a collection of data, functions, and executable code that are
treated as an atomic unit, with certain characteristics shared by all parts
of the class. It hides much of its' internal data and exposes only the data
and functionality that is useful and safe to be accessed. Object-oriented
programming involves a good bit more than this, however, so your request for
a source of information is well taken.

I would recommend downloading the free .Net SDK from Microsoft for more
information (at least to start with). This is the most excellent software
documentation I have ever used for any product, and it is not only a
reference, but has many articles and samples as well. The URL for download
is:

http://msdn.microsoft.com/library/default.asp?url=/downloads/list/netdevframework.asp

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.
 
Back
Top