ASP Basics

|< < > >|

3-c: All About Arrays

And now for a new way to store information .. arrays. Arrays are a very handy storage method. Think of arrays as variables on steroids. Imagine you wanted to store 20 different people's last names in variables. It would be quite a pain to create and keep track of strLastName1, strLastName2, etc. Not very efficient, right? That's where arrays come in. With an array you can create one variable that will have 20 slots, one for each person's name. Here is how

Listing Last Modified: Mon Jun 13 2005

 


Views: 65

4-a: Do the Math

Even though you probably won't be doing much serious math in most of your ASP applications, it's still a good idea to review some of the more common math functions. Being that as it may, here are the more common VBScript mathematical functions:

Listing Last Modified: Mon Jun 13 2005

 


Views: 70

4-b: Messing with Strings

Let's move on to some string functions. You will probably find yourself using string functions infinitely more than the mathematical functions above. The reason is that most of the data you interact with on the web is in the form of strings, i.e. people's names, addresses, web URL's, e-mail addresses, etc. Here are some of the most commonly used string functions. I have tried to give an easy to understand example of each function. We'll discuss the practical applications of some of the functions later. Here they are:

Listing Last Modified: Mon Jun 13 2005

 


Views: 73

4-c: Nailing Down a Date & Time

You probably won't find yourself manipulating dates and times as much as strings but you will use these functions quite a bit. Here are some practical uses for the functions above:

Listing Last Modified: Mon Jun 13 2005

 


Views: 69

5-a: Response.Write: Talking to the User

You will probably find yourself using Response.Write more than anything else in ASP. It is used to send output to the browser for the user. You will also find that you will use Response.Write frequently when debugging your pages and applications. So, how does it work?

Listing Last Modified: Mon Jun 13 2005

 


Views: 68

5-b: Response.Redirect: Moving the User Around

Response.Redirect is kind of like a call forwarding button. It sends the user on to any location you designate. The syntax is virtually the same as Response.Write. Instead of entering a word or phrase that you want to be sent to the browser, you enter the URL of the destination that you want the user to be redirected to. For example:

Listing Last Modified: Mon Jun 13 2005

 


Views: 66

5-c: Response.Cookies: Memorizing Stuff About the User

Cookies, as you probably already know, are small files that are stored on the user's computer. They are used by web developers to store all sorts of basic information such as names, dates, preferences, ID numbers, etc.

Listing Last Modified: Mon Jun 13 2005

 


Views: 65

5-d: Request.Cookies: Getting Stuff Out of a Cookie

As promised, we will continue the practical example from the last lesson by retrieving information from our cookie and displaying the number of days since the person's last visit. I'll give you the code and then we'll take a look at how it works:

Listing Last Modified: Mon Jun 13 2005

 


Views: 71


|< < > >|