If you’re like me, you may be a little overwhelmed with your first introduction to ASP.NET. Microsoft has really gone all out this time and they have given us a completely new framework to work with. A change of this magnitude is rarely seen in the software world and it’s no wonder some of us are hesitant to try it. One thing I can assure you of is that it is well worth your time to learn. In this article I will discuss some of the advantages of ASP.NET, what has changed, how to get started, and where to look for help. This article is intended for those new to ASP.NET.
I have worked mostly with VBScript when programming my ASP applications. As a diehard fan of classic ASP I was a bit skeptical when initially reviewing the new platform. As I read more into it and started testing the new framework I realized the superiority at hand. I would bet that any experienced application developer has a list of things they wish they could change about their current coding techniques. I would also bet that ASP.NET solves 90 percent of those issues. In fact, the whole “Dot NET” revolution is changing the way we work. That’s another story though.
ASP.NET offers several key advantages over classic ASP. In my opinion one of the worst things about ASP is that you often end up with so called “spaghetti” code within your applications. Not only is it a less effective way to program, it also causes readability problems after the fact. ASP.NET comes to the rescue with a much more integrated approach. Using server controls and functions you can separate application logic from presentation code easier than ever before. Some of you may be wondering how this is possible, but trust me, you will understand once you start working with examples. If you have been afraid to try XML, you will feel much better about it once you start working with any Microsoft.NET examples.
Another simply fantastic feature of ASP.NET is the error codes that are sent back to the browser. Most of us who are familiar with classic ASP are used to the 2 or 3 line meaningless messages that we have to decipher. What a relief ASP.NET is! You will be amazed at the clarity and details provided from the server about any errors within the page. It is simply amazing. A much needed improvement.
What’s changed you say? Not a whole lot in terms of code syntax. In my opinion there are 3 major changes that will affect your programming. First, page functions must be declared differently. You can’t use the old <%%> any longer. We now have to use <script runat=server> blocks instead. Second, the request collection now has to be explicitly called.
<%
'classic ASP
response.write request.form("text")
//or
response.write "request.form("text")"
%>
//ASP.NET
response.write (request.form("text"))
Finally, we no longer use the SET command. For example:
‘classic ASP DIM rs set rs = conn.execute(sql)
//ASP.NET DIM rs rs = conn.execute(sql)
If you are looking to get started with ASP.NET there are several excellent resources dedicated to the cause. I would recommend http://www.gotdotnet.com/ , http://www.asp.net/ and of course all the great authors here at ASPAlliance.com. If you currently run your own server you simply just download the framework, install it, reboot the machine, and away you go!
Once you are familiar with VB.NET your old classic ASP skills will begin to shine once more and you will wonder… how did I ever live without this?
For a detailed explanation of these concepts and code examples you can visit the ASP.NET (http://www.asp.net/Tutorials/quickstart.aspx) web page tutorial section.
Good Luck and Happy Coding