Home arrow ASP.NET arrow Using Objects in ASP.NET: Part 1/2

Using Objects in ASP.NET: Part 1/2

Obects are a big part of .NET. In this 2 part article series, Craig shows us how to use objects with ASP.NET, focusing mainly on providing clear working examples.

Author Info:
By: Wrox Team
Rating: 5 stars5 stars5 stars5 stars5 stars / 139
February 25, 2003
  1. · Using Objects in ASP.NET: Part 1/2
  2. · Some of the Grander OOP Features
  3. · Class Members
  4. · Class Accessibility
  5. · The Constructor
  6. · Conclusion

print this article

Using Objects in ASP.NET: Part 1/2
(Page 1 of 6 )

Objects and Object oriented programming have been around for a long time in mainstream desktop and client/server programming (since 1967 in fact.) Traditionally, web development has been dominated by procedural based scripting languages. It is only recently that OOP has begun to integrate into the web-programming world. Languages used to create dynamic websites such as Java, Perl, PHP and Coldfusion have begun to implement object-orientation into their feature sets or improve on the OOP features they already had. In ASP 3, objects could be manipulated or created through COM and VBScript. However, in ASP.NET, Microsoft has brought ASP to a new level of "object-orientedness" not previously seen in web programming languages.

Perhaps you’ve been using ASP.NET for a while and you’re not sure if you’re doing everything right when it comes to this OOP stuff. Or perhaps you are still writing ASP.NET code primarily in a script fashion similar to ASP 3. With these two articles, Craig Bowes will discuss how to use OOP features in your ASP.NET web applications.

To do the examples in this article, you’ll need the following software:
  • The .NET framework
  • IIS
  • The .NET SDK to compile your applications
  • Visual Studio .NET, Web Matrix or your favorite text editor.
You should also be somewhat familiar with at web programming in one language, preferably VB 6 or VBScript. I’ll show code related to this article in VB.NET, but also have the examples downloadable in C# as well. You should also already know how to compile files using the SDK or VS.NET.

Target Audience
Chances are you are probably familiar with objects and object-oriented programming. In fact, this article assumes that you know enough to be able to compile a VB or C# file and use the basic event handling features in ASP.NET such as the Page_Load event handler. A complete study of OOP would be a topic that could easily fill many volumes and there are many articles, books and websites devoted to OO theory. Such a study is outside the scope of this article. However knowing what OOP is and does is different than knowing how use it in code. In this article, we’re going to look at the basic OOP features in the .NET framework and laying the ground work for using things like classes, constructors, methods, fields and properties in ASP.NET. In Part II, we’ll look at more advanced features and architecture in OOP. This will include inheritance, polymorphism, aggregates and interfaces.

An outline of what we’ll cover is as follows:

Part I: Using Objects

Intro to Objects and OOP
  • Building a Class
  • Instantiating Objects & the New statement.
  • Constructors, Fields, Methods, Properties
  • Accessibility: Public, Protected, Private, Internal, Virtual
Part II: Advanced Architecture

Implementation Inheritance
  • Overriding Methods/Polymorphism
  • Abstract Classes
  • Aggregation/Composition
  • Interfaces
Perhaps you’ve been using ASP.NET for a while and you’re not sure if you’re doing everything right when it comes to this OOP stuff. Or perhaps you are still writing ASP.NET code primarily in a script fashion similar to ASP 3. If you are already a strong "object architect" that has used object-oriented features such as aggregation, polymorphism and inheritance for years, then this article will probably seem a bit basic for you. Hard-core Java and C++ programmers will probably fall into this category. However, if you’ve been writing mostly procedural or non-OOP code in your classic ASP web applications using VBScript, then this article may help you get a handle on writing OOP style code with ASP.NET’s new features.
blog comments powered by Disqus

- How Caching Means More Ca-ching, Part 2
- How Caching Means More Ca-ching, Part 1
- Reading a Delimited File Using ASP.Net and V...
- What is .Net and Where is ASP.NET?
- An Object Driven Interface with .Net
- Create Your Own Guestbook In ASP.NET
- HTTP File Download Without User Interaction ...
- Dynamically Using Methods in ASP.NET
- Changing the Page Size Interactively in a Da...
- XML Serialization in ASP.NET
- Using Objects in ASP.NET: Part 1/2
- IE Web Controls in VB.NET
- Class Frameworks in VB .NET
- Cryptographic Objects in C#: Part 1
- Sample Chapter: Pure ASP.Net

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials