By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Function Library

P: n/a
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.
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
PJ
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/...ns/default.asp

~PJ

"Chris Jackson" <so*****@microsoft.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
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.

Nov 17 '05 #2

P: n/a
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" <so*****@microsoft.com>
!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: <eP**************@tk2msftngp13.phx.gbl>
!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!tk2msftn gp13.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.
!
!
!

Nov 17 '05 #3

P: n/a
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/de...vframework.asp

HTH,

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

"Chris Jackson" <so*****@microsoft.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
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.

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.