Richard Dudley

Pencil Bros. Geology, Inc. "We Deliver" Quality Assured * Satisfaction Guaranteed

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

Pittsburgh Dot Net

Crystal Reports .NET

Subscriptions

Post Categories

Article Categories



Development

Development
Upgrading to ASP.NET

I was like you some time ago.  VBScript and JavaScript served me well for years, I made money selling products through sites I created with these technologies, and I made money selling my skills with these technologies.  Technology changes quickly, and it was time for me to catch up.  Same for you, apparently.  This series is part of my transition from ASP to ASP.NET.  I hope it helps.

One of the great things about the .NET environment is that nearly any language can be used.  Microsoft itself produces VB.NET, C# and J# for VB, C and Java people.  There are third party ports of Perl, Cobol, PHP and even Pascal!

 

Getting Started

You're going to need the .NET framework, and some sort of editor.  FP 2003 will work to an extent (see below).  There's also a free editor from Microsoft called WebMatrix.  You don't need to purchase Visual Studio, although having used all three programs mentioned here, I do prefer Visual Studio (I also need the Crystal Reports that comes bundled with it).  However, if you're just using ASP.NET, and you're on a budget, the WebMatrix will do everything you need quite well.

Download both WebMatrix and ASP.NET Framework from http://www.asp.net, or get them on the CD included with “ASP.NET Unleashed” (see below).

A good places to get started is the ASP.NET roadmap.  The skill level goes from basic to advanced in a hurry, to work through this at your own pace, and probably with

ASP.NET Roadmap (MS Knowledge Base)

This article provides a roadmap to learning and mastering ASP.NET. Roadmap articles provide links to useful information, including online documentation, Microsoft Knowledge Base articles, and Microsoft white papers, to help you learn about a Microsoft product or technology.

Migrating ASP Applications to ASP.NET (Able Consulting)

Top 10 (make that 11) Paradigm Shifts and Migration Strategies when moving from ASP to ASP.NET.

One of the most radical paradigm shifts between ASP and ASP.NET is how forms are handled.  Form in ASP.NET are referred to as WebForms (a Windows application is called a Windows Form, or WinForm for short).  In ASP.NET, you can only have one form per page, and the page posts back to itself.  In classic ASP, you could have as many forms as you wanted, and send each one to a different page (usually referred to as the form handler).  What seems bizarre at first is actually a really cool part of the language.  Instead of having different form handlers for each form as in ASP, you have event handlers for the different controls on your page in ASP.NET.  In ASP.NET, when a user clicks the Submit button, the form is posted back to itself, and the SubmitButton_Click subroutine is fired.  Your form handling goes in this subroutine.  Want different buttons to do different things?  It's as easy as adding buttons to your page, giving them different names, and creating the corresponding event handlers.  Easy!  Where you had at least two pages before, you now only need one page.

Learning Materials - Tools

One of my favorite tools for web development is Front Page.  Currently I use FP 2003 in conjunction with VS 2003.  FP 2003 has some ASP.NET capabilities, although not as nice as VS (but also significantly cheaper).  I haven't seen any information on using WebMatrix in conjunction FP 2003, so I'll try and develop some.  You can configure the WebMatrix as the external editor for ASP.NET files (.ASPX, .ASCX, etc), which would give you the ease of website management from FP and more powerful editing capabilities of a .NET IDE from WebMatrix.

Another option is a FrontPage 2003 plugin that allows you to insert controls from a combo box and set properties on a “property gird“ (we have this in VS--trust me, they're easy).  Click here for the ASP.Net Control Add-In for FrontPage 2003.

The major downside in using FrontPage 2003 alone with ASP.NET is that FP2003 does not support code behind, and does not have integrated compilation.  Codebehind is a great new feature, where all the server side code is placed in a separate file, away from the HTML code.  Very nice, especially if one person is doing design and another is programming.  The lack of code behind means that you'll still handle server side code as in classic ASP.  Command line compilers are installed in the .NET framework, but you have to go to an old fashioned DOS prompt to use them.

Another downside to FrontPage 2003 is that it does not have IntelliSense for ASP.NET code (this means you'll actually know the syntax, unlike us VS addicts who are lost without IntelliSense).

Using ASP.NET with FrontPage 2003 (MSDN Library)

The ASP.NET Web Matrix Project Reloaded! (4GuysFromRolla.com)

The .NET Show: ASP.NET Web Matrix

The .NET Show (link above) is a video that can be streamed online or downloaded for off-line viewing using Windows Media Player.

The ASP.NET team has done some groundbreaking work at building an exciting tool to aid ASP.NET developers. This tool is "ASP.NET Web Matrix" and while it is both free to download, and just barely over a megabyte in size, it also is an amazingly full featured tool that truly makes ASP.NET development easy and fun.

In today's episode we will be talking with Scott Guthrie and Nikhil Kothari from the ASP.NET team. They'll show us how ASP.NET can enable Web sites with greater functionality, and then walk us through a couple of demonstrations of how easy it is to install and utilize Web Matrix.

Microsoft Frontpage 2003 Inside Out (link to amazon.com)
The “Inside Out“ book has information on using ASP.NET with FrontPage 2003, as well as a chapter on using FrontPage 2003 and Visual Studio .NET 2003 together.  This chapter is also available free online at Chapter 43: Using FrontPage 2003 and Visual Studio .NET Together.

 

Software Development: Take command of your .NET code
A short overview about the compilers installed in the .NET framework.

Learning Materials - Programming Concepts and Languages

ASP.NET and ASP are similar in name only.  ASP could be programmed with simple scripting languages such as VB Script, PHP or JavaScript.  ASP.NET is backed by powerful managed code.  VB.NET and C# are “real“ programming languages.  There are a number of cognitive leaps that need to be made in order to start using the full potential of these languages.  Here are a few articles to help get you started:

VB.NET and C# Programming Basics Part I: Object-oriented Programming Concepts (asp.netNOW magazine)

VB.NET and C# Programming Basics Part II: Separating Code from Content with Code-Behind (asp.netNOW magazine)

PHP to ASP.NET Migration Guide

This section provides resources for PHP developers who are interested in learning more about building web sites with ASP.NET.

Download Visual Studio .NET 2003 Posters
Visual Studio ships with a number of large posters that show how the different .NET classes are related, and break down some classes into their parts.  These are interesting at first, useful later on.  The posters are quite large, and you'll probably need to go to Kinko's to get them printed full size.  You can scale some of them down, but you'll need very good eyes to read them.

I read a couple of introductory books when I was starting out.  My favorite was:

ASP.NET Unleashed (link to amazon.com)
This book presents ASP.NET with simple examples that will function in WebMatrix as well as Visual Studio .NET 2003. They will probably work in FP 2003 if you work through the previous resources first, and can adapt to the different environment.  The companion CD includes WebMatrix, .NET Framework 1.1,  .NET SDK and MSDE 2000.  If you're on a dial-up conenction, this will save hours of downloading.

Pure Javascript (2nd Ed) (link to amazon.com)
This is the best JavaScript book I've seen.  It's tempting to use the Postback with ASP.NET server controls.  However, more than one or two of these on a page will really slow down your visitor's interaction with your website.  ASP.NET also introduces a CustomValidator control, which should have a client-side JavaScript function component written for it.  Client side JavaScript may be even more important with ASP.NET as it was with classic ASP.  This book is an absolute steal if you buy it used with the CD.

Upgrading Database Connectivity

A couple of good articles to read:

Migrating from ADO to ADO.NET (MSDN Magazine Datapoints)

I will discuss several data access situations, show how to tackle them with ADO, and show how they are accomplished with ADO.NET in ASP.NET using C#. I'll begin with the similarities in connecting to a data source. Then, I'll look at how the ADO Recordset object has evolved into many distinct and focused objects and methods in ADO.NET. Finally, I will explore firehose cursors, returning a single value from a rowset, and working with XML.

Migrating Code and Concepts from ADO "Classic" to ADO.NET

ADO.NET is becoming the new standard for data access, but what about all of that COM-based ADO code you wrote over the last five years or so? Learn more about design choices and decision points for migration.

posted Thursday, May 13, 2004 8:15 PM by richard.dudley




Powered by Dot Net Junkies, by Telligent Systems