Moving from ASP to ASP.NET

Although ASP.NET is based on the ASP technology, a lot of the fundamentals have changed. Here we explore some of the basic changes that you will encounter when migrating from ASP to ASP.NET.

<%%> Versus <script>

In ASP, all server-side code is written between <% and %> tags. This tells the ASP interpreter that everything between the two tags is program code and should be executed on the server.

In ASP.NET, the rules have changed a bit. Now, all variable and function declarations are placed between <script> and </script> tags, while implementation logic is contained in between the <% and %> tags. Listing A.1 shows an example ASP page, and Listing A.2 and Listing A.3 show the same page written in ASP.NET, using Visual ...

Get Debugging ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.