.NET Articles
Using a Custom Base Class for your ASP.NET Page's Code-Behind Classes 13 Apr 2005 00:00 GMT
One of the many benefits of object-oriented programming is that it allows for reuse of logic. For example, classes can
be created that contain a base level of functionality. These base classes can then be extended through inheritance to
create new classes that encompass the functionality of the base class along with any custom logic needed. The end result
is that as a developer, once the base class has been created, you can extend and enhance the functionality of the base class
with minimal effort. (For a more in-depth look at inheritance be sure to read Ian Stalling's article,
Using Object-Orientation in ASP.NET: Inheritance.)
Since the .NET Framework is built upon the principles of object-oriented programming (OOP), it's no surprise that ASP.NET borrows
heavily from the tenets of OOP, one such tenet being inheritance. The base functionality for all ASP.NET pages is spelled out
by the Page class in the System.Web.UI namespace. This class defines the essential properties, methods,
and events for an ASP.NET page, including such members as:
- The intrinsic objects -
Response, Request, Session, and so on, - Common properties -
IsPostBack, IsValid, and others, - Methods used throughout the page lifecycle, such as
SavePageViewState(), ProcessRequest(),
RaiseChangedEvents(), and others.
While all ASP.NET pages must be derived from the Page class, they need be directly derived. That is, an ASP.NET
page may extend a class that, itself, extends the Page class. In fact, when using the code-behind model for
creating ASP.NET pages the actual ASP.NET page is derived from the code-behind class, with the code-behind class being derived
from the Page class.
In fact, oftentimes it makes sense to create a base class for a particular ASP.NET Web application that extends the
Page class and have all code-behind classes derive from this class, rather than directly from the
Page class. This universal base class can contain its own properties, methods, or events that are common to all pages
in the particular ASP.NET application, or it can extend the functionality of existing methods or properties. In this article
we'll look at how to create and start using a custom base class. Read on to learn more!
Read More > Source: 4GuysFromRolla Skin Your Web Apps Using MVC 11 Apr 2005 08:00 GMTThe Model-View-Controller architecture, built into ASP.NET, lets you drive a different look to your ASP.NET pages using the same code base. Source: DevX MSDN TV: Introduction to Indigo 08 Apr 2005 07:00 GMTIndigo is the managed communication stack that will ship with WinFX. It is the "V.Next" for ASP.NET Web Methods, .NET Remoting, Enterprise Services, System.Messaging, and WSE. Steve Swartz provides a brief conceptual overview of Indigo, walks through some code, and introduces you to his jackalope. Source: MSDN Review: Peter's Date Package 1.1 08 Apr 2005 00:00 GMTAlmost every web form I build seems to require some sort of date data to be entered. Whether it's credit card expiration dates or start and end dates for a report, I run into this all the time, and the built-in ASP.NET Webcontrols for capturing this data are lacking, to put it mildly. Peter Blum (of PeterBlum.com) has a solution to this common problem with his Date Package, which I review here. It's not perfect, but it's definitely recommended. Source: AspAlliance
|
|
|