INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

HANDLE


PASSWORD
Remember Me
Forgot Password?

Come Join Us!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • Turn Off Ad Banners
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

E-mail*
Handle

Password
Verify P'word
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...I have tons of books, have book marked tons of tutorials, which have helped, but this forum has answered those "impossible to find" solutions. I am thrilled with this site..."

Geography

Where in the world do Tek-Tips members come from?

Microsoft: Active Server Pages (ASP) FAQ

ASP 101

ASP: VBScript vs. JavaScript
Posted: 23 Sep 02 (Edited 15 Apr 03)

As someone who has recently dealt alot with the topic in my own programs, it seems reasonable that other may have the same questions I did.

You can write ASP in JavaScript

Most people who write ASP write the server side programming in VBScript, and use JavaScript for the client side. While this is a very functional way, and often times easier way to do it, it is not the only way.

Again, You can write ASP in JavaScript
(or JScript if you are using IIS).

ASP really is only a collection of objects,methods, properties that apply to certain server objects that the webserver can utilize. How you choose to access these objects is up to you.

Example:

response.write "Test" will work in VBScript.
Response.Write ('Test'); in JavaScript.


The Response object and it's Write method are what is ASP. How you reference them is dependent on the language (i.e.Case Sensitivity, semicolons, etc.....)

The key is to separate the differences between what is ASP and what is the language.

A recent example is use the now() function in VBScript.

myvariable = now() (VBScript)
myvariable = getDate(); (JavaScript)


This is because the date function is dependent on the lanauge not on ASP.


Bottom line is, ASP can be done in a large variety of languages. And while VBScript is the most common (Becuase Microsoft pushes ASP vice JSP) it is not the only option. So you don't have to learn a new scripting language to utilize the power of ASP. You just have to learn how to adapt it's objects to your language of choice.


As a addition(becuase someone requested some more examples) here you go

Accessing the Request Object
JavaScript:
     Request.QueryString("itemname");
     Request.Form("itemname");
     Request.Cookies("itemname");
     Request("itemname");

All the real difference here is that becuase JavaScript is case sensitive, you need to watch that.


Alot of people are apparently also confused by differentiang between client and server side script

Client Side:
     <script language="JavaScript">
         alert('This is a test'):
         document.form.field.value='test';
     </script>

Notice, the alert command and the document object can only be referenced on the client side. But again, these will always be in script tags like those shown above.

Server Side:
      
      <%
         if (Request.Form("name")) {
            Response.Write ("This is a test");
         }
      $>

Server side content looks much like it would with VBScript. Again, the main part is learing what is actually part of the ASP Server Objects, and what is the language used to access those.

If you have any question please let me know. And as I come across new things I will make sure to put them out here for you.

Back to Microsoft: Active Server Pages (ASP) FAQ Index
Back to Microsoft: Active Server Pages (ASP) Forum
My FAQ Archive
Email This FAQ To A Friend

My Archive