Basic file structure of ASPAfter installing IIS the web server let us start our first ASP page. Here we assume that ASP engine is working perfectly and server root is set to proper directory were we will keep our fist asp page. Here if the directory path is E:\myfiles\ and our first ASP file name is test.asp then the path becomes E:\myfiles\test.asp. To open this file in web browser mode we have to open this as
In the next line we will tell that all the variables used here are to be declared before using. This has some advantage as we move to words developing complex applications using ASP. This is a good practice to follow. So here is our next line
After this we will keep our html meta tags and then we will go to the body section of the ASP page. We will try to print the message “Hello World” to the screen. Here we will store this message string in a variable and let us name the variable as msg. Please note that we have told ASP engine that all the variables we use are to be declared before, this we have told in the second line of our code by saying <% Option Explicit %> . So we will declare the variable by using the command Dim. Here is the example
Now let us print the message or the variable to the screen by using Response.Write object.
That’s our entire first ASP example. Here is the complete code.
This article is written by plus2net.com team.
Be the first to post comment on this article :