Recent Articles

ASP.NET: Permanent Redirection
The easiest way to make a redirection in ASP.NET is using Response.Redirect(url). What it actually does is, that it creates a response with the "302...

Validating a URL with Regular Expressions
I had to build web form that took user input from standard ASP.NET input controls.

Visual Studio 2005 - Publishing Web Site
What's the purpose of site precompilation? As it turns out, improved performance is often brought as an evidence of the benefits of precompilation.

Microsoft Bridging VB6 And .NET Forms
A new toolkit from Microsoft will allow VisualBasic 6 developers to craft .Net WinForms that can be displayed in a VB6 application.

ASP.NET: How To Create Custom Trace Messages
This article is an excerpt from the book: Murach's ASP.NET 2.0 Web Programming with C# 2005. The Trace feature is an ASP.NET feature that displays some...

How To Use Breakpoints
This article is an excerpt from the book: Murach's ASP.NET 2.0 Web Programming with C# 2005. Figure 4-9 shows how to use breakpoints in an ASP.NET application.

How To Use The Exception Assistant
This article is an excerpt from the book: Murach's ASP.NET 2.0 Web Programming with C# 2005. Figure 4-9 shows how to use breakpoints in an ASP.NET application.

11.30.06


Refactoring Your ASP.NET Project

By Mads Kristensen

One day at work i was refactoring my code as I do everyday, when it suddenly hit me that our ASP.NET projects were also refactored in a sense.

For those of you who don't know what refactoring is, here's a definition.

"Refactoring is making changes to a body of code in order to improve its internal structure, without changing its external behavior".

In layman's terms it means the process of cleaning your code and break it up in smaller more maintainable pieces.

It's a discipline most programmers are accustomed to and have been using for years no matter the programming language or platform.

The principle of refactoring should also be upheld when designing the structure of your ASP.NET projects. This is typically done by moving code to user controls for reuse and maintainability.

However, there is a big difference in refactoring a C# class library and the ASP.NET pages/controls.

Low Rate eCommerce & Retail Plans

Whereas refactoring is an ongoing process in a class library type of situation, it is more a static one in the ASP.NET scenario or much more difficult to do.

For instance, if you want to move a region of a page to a user control, you have to move the little individual pieces as well. The list of things to move usually contains the HTML, JavaScript, image references and the C#/VB.NET logic.

That's a whole lot more than you would do in a class library situation and that's why you have to do a lot of planning before you create your ASP.NET architecture.

That kind of architecture is very important because of the difficult refactoring process in ASP.NET, and that's why you should plan ahead before you start writing your pages and user controls.

It's a tough job to correct when your project grows bigger and more complex and projects tend to do just that.

I know refactoring isn't the same as designing the structure, but it's probably the closest thing we can get to refactoring ASP.NET pages and user controls.


About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

About WebProASP
WebProASP is a collection of up to date tutorials and insightful articles designed to help ASP users of any skill level implement successful ASP systems and practices. ASP Strategies and Tactics for Business

WebProASP is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQlProNews.com
ITcertificationNews.com SysAdminNews.com
WebProASP.com WirelessProNews.com
CProgrammingTrends.com ITManagementNews.com




-- WebProAsp is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2006 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



ASP Strategies and Tactics for Business WebProASP News Archives About Us Feedback WebProASP Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact