As was mentioned in the last lesson, ASP uses VBScript as its default scripting language. VBScriptis similar to Javascript, a client side programming language used to add functionality through the <script> tag.
But the most preferred way to include VBScript in your HTML file is as follows −. Example to show how you can include an external VBScript file in your HTML.
Read the following paragraph carefully!
VBScript, when used to program ASP converts it to serverside scripting. Any given web page could be created froma combination of server side and client side scripting. The confusing part is this: You must use these client side scripting languages (Javascript, VBScript, etc) to program in ASP!
Below we have a simple ASP script programmed in VBScript and includes the necessary HTML as well. This is only server-side scripting.
Display:
The date is:
If you already know VBScript or Visual Basic programming then you'll recognize Dim as Dimension, which is used to 'dimension' variables. It is a good programmingpractice to 'dimension' all your variables before you use them, as we did with myString in theabove example.
![Vbscript sample scripts Vbscript sample scripts](https://cdn.softwaretestinghelp.com/wp-content/qa/uploads/2018/01/Example-1.jpg)
Now that we have our ASP Code working, say that we wanted to use our ASP code along with someclient side Javascript code. To keep it simple we are just going to use the Javascript write function and have ourASP Code fill in the Date. All the Javascript client code is in thedefault color, but ASP Server Side Code is in Red.
ASP Code with VBScript and Client Side Javascript Code:
Display:
If you just want to program in ASP you can disregard the above example if you find it confusing.Just remember that you can have client-side Javascript code and server-side ASP/VBScript code included in an ASP generated web page!
You should be able to follow along with our ASP tutorial with little or no VBScript knowledge, butjust in case you want to know more or find some of the VBScript syntax or code confusing then you can check out ourVBScript Tutorial.
Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!