Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book

Classic ASP versus ASP.NET

Classic ASP goes a long way toward simplifying Web programming. It is often much easier to write some HTML and mingle it with script than it is to write a new DLL from scratch. Still, classic ASP is not without its issues. First, ASP pages are often just an unstructured mass of code. Classic ASP is very much like the early days of Basic programming, when you could get something done quickly but the resulting code was often difficult to follow. The ASP object model has numerous intrinsic, or global, objects. For example, when writing script code to generate the content of an HTTP request, you send the content out to the client using the intrinsic Response object. For simple applications in which you can guarantee that only one client is involved in talking to your Web application, this isn't much of a problem. But how many Web applications can guarantee this? (The number is probably very close to zero—if it is not actually zero.) Because of the way ASP is structured with these intrinsic objects, managing the state of clients is a nightmare.

ASP.NET evolves classic ASP. For example, you still have the same intrinsic objects in ASP.NET and you can add scripting wherever you want it on the page. In fact, most ASP pages can easily be brought over and run as ASP.NET pages by renaming them with the .aspx extension.

ASP.NET brings a lot of new features to the table. First, ASP.NET pages are compiled into assemblies just like the other components within .NET, providing both performance and security benefits. Second, ASP.NET supports using any .NET language within it. No longer are you confined to using JavaScript or VB Script on your Web pages. You can now use more structured languages. ASP.NET lets you write the executable parts of your pages in C# or full-fledged Visual Basic.

ASP.NET brings with it a whole new programming model incorporating Web forms, server-side controls, data binding, and Web services. Web forms and server-side controls work by tailoring the markup language they spit out to match the client browser attached. Data binding formalizes exchanging data between controls at runtime (such as edit boxes and combo boxes) and data variables within the Web site program. Finally, Web services formalize the process of getting multiple computers talking to each other automatically using XML and HTTP (SOAP). ASP.NET is ripe for creating Web services in which a machine's software can reveal itself to the rest of the world as a SOAP server.

  • + Share This
  • 🔖 Save To Your Account