Tutorial-Web Home > An Overview in the Differences Between ASP and ASP.net > Section 3: ASP.net Differences 2










Site Menu

An Overview in Creating an ActiveX DLL for Use with ASP Scripts

Available ActiveX Components for Download

Search the Web for other ASP Tutorials

Subscribe to Tutorial-web's mailing list.

A Note From the Author

A Good ASP.net Resource
cover
More Resources











Array of Sunlight (or not)

ASP allowed array values to be passed via a querystring or form post and then received by a request on the receiving page. In order to access these values you simply had to request the variable with the array position following. This type of system was based upon a 1-index, meaning the first value was always in the 1 position. There are two big changes here. First of all, it has changed to a 0-index, meaning the first value will be in the 0 position. This is more concurrent with other compiled languages. Secondly, in order to access the values in an array from a querystring or the like the GetValues method must be called.

ASP:

<%
Variable1=Request.QueryString("values")(1)
%>

Asp.net:

<%
variable1=(Request.QueryString.GetValues("values")(0)
%>

Ready, “Set”, Go!

With ASP whenever an object was created or a database connection needed to be made a variable was usually assigned using “Set". In Asp.net there is no more need for variables to be “Set”, the variable must be simply made to be equal. This also applies to "Let".

ASP:

<%
Dim Connection
Set Connection = Server.CreateObject("ADODB.Connection")
%>

Asp.net:

<%
Dim Connection
Connection = Server.CreateObject("ADODB.Connection")
%>

Previous    Next


Sections

Section 1: Introduction
Section 2: ASP.net Differences 1
Section 3: ASP.net Differences 2
Section 4: Final Differences and Conclusion

Sponsors

Search Now:
In Association with Amazon.com
www.goto.com Search the Web.
Type it and go!