AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=314&pId=-1
Moving to ASP.NET
page
by Chris Garrett
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 11231/ 17

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!


Product Spotlight
Product Spotlight 

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-25 4:09:10 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search