Moving to ASP.NET
page 1 of 1
Published: 03 Dec 2003
Unedited - Community Contributed
Abstract
Although you can't just rename your .ASP's to .ASPX's and expect them to work, for anyone familiar with VBScript and Classic ASP it should not be too difficult to get to grips with the new ASP.NET/Visual Basic.NET combo.
by Chris Garrett
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 22528/ 21

Moving to ASP.NET
Moving to ASP.NET
by Chris Garrett

Although you can't just rename your .ASP's to .ASPX's and expect them to work, for anyone familiar with VBScript and Classic ASP it should not be too difficult to get to grips with the new ASP.NET/Visual Basic.NET combo.

With few exceptions, ASP.NET is compatible with traditional ASP.


Getting started

  1. Once you have downloaded and setup the .NET Framework [http://www.asp.net/b2download.aspx], start a new document called something like "test.aspx".
  2. Enter into the document <% response.write("Hello world") %>
  3. Save the document and launch in your browser

Congratulations, your first .ASPX :O)


So why can't I just rename my .ASP's??

  • ASP.NET pages support only a single language.
  • ASP.NET page functions must be declared in script blocks.
  • Page-render functions are not supported
    Set and Let assignments are no longer supported in Visual Basic.NET.
  • Non-indexed default properties are not supported in Visual Basic.NET.
  • Parentheses are required for calling subroutines in Visual Basic.NET.

A lot of ASP programmers use either VBScript OR JScript, so this will not be too much of a pain. When I have used multiple languages it has been when either updating someone elses script or in pre-regular expression days I would use perlscript. No worries there.

Most scripts will need editing to take into account functions defined in <% %>blocks and subroutines requiring parentheses, but that is a copy&paste job. Not being able to put HTML inside functions without using response .write directly is a real pain, but I expect it was not good practice in any case.

Creating objects without the "set" is no big hassle, but I expect I have a lot of code to sort through to find where I have called rs("fieldname") and will have to change to reference ".value" instead.


So, no worries then, eh?

Remember though, classic ASP is not going to dissapear overnight and both can coexist on the same server, just look at ASPAlliance.com!



User Comments

Title: That's it?   
Name: YB
Date: 2008-11-24 2:21:54 PM
Comment:
i have tons and tons of questions on ASP vs ASP.NET and i CANNOT find any answers. all "quick start" .NET sites give you an overview but not how to change the business logic, etc. it's very frustrating or am i just stupid?
Title: Shiko   
Name: Dirar
Date: 2007-07-30 4:45:18 AM
Comment:
I am having a problem changing the logic I was working on for some years in ASP. Now I have to move to .net and I hate it.
Title: Less Infornation   
Name: Anup
Date: 2006-10-03 6:09:18 AM
Comment:
please provide some examples
Title: Good   
Name: Kaps
Date: 2005-07-09 5:57:36 AM
Comment:
Site is good but it will be more good if there will be related examples
Title: Good But   
Name: Thada
Date: 2005-04-02 1:52:47 AM
Comment:
Your site is very good but I want to know clearly about comparison of ASP and ASP.net. So, explain about it pls. Thank u for your kindness.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-05-28 6:22:04 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search