In the past, developers like to use Visual Basic, VBScript and JScript reasons for the reasons for them are their so-called "non-type" nature. Variables do not require explicit type declarations and can be simply created by use. When allocated from a type to another, the conversion will be executed automatically. However, this convenience will greatly damage the performance of the application.
Visual Basic is now supported by using the Option Strict Compiler instruction to support type security programming. In order to backward compatibility, the ASP.NET does not enable this option by default. However, in order to get the best performance, it is highly recommended to enable this option on the page. To enable Option Strict, include the strict property in the @ page directive, or for the user control, include this property in the @ Control instruction. The following example demonstrates how to set this property and four variable calls to display how this property is to cause the compiler error.
<% @ Page language = "vb" strict = "true"%> <% DIM BDIM C AS STRING
'This will cause a compiler error.a = "hello"' this will cause a compiler error.b = "world" 'this will not cause a compiler error.c = "!!!!!!"' But this Will Cause a Compiler Error.c = 0%>
JScript .NET also supports non-type programming, but it does not provide compiler instructions for enforcement early binding. If any of the following occurs, the variable is late binding:
Explicitly declared as Object. It is a field of classes that have no type declaration. It is a dedicated function or method member of the non-obvious type declaration, and it is impossible to use it to use it. The last difference is more complicated because if the JScript .NET compiler can infer the type according to the usage of the variable, it will optimize. In the example below, the variable A is early binding, but the variable B is late binding.
VAR A; VAR B;
A = "Hello"; b = "world"; b = 0;
To achieve the best performance, when declaring the JScript .NET variable, assign a type. For example, VAR A: String.