4:00 pm Saturday, July 31, 2010
     
SERVER TRANSFER COMPLETE. UNDER CONSTRUCTION.
            Search About Contact Home
Creating Your First ASP Page Tutorial
AaronOutpost : ASP / Tutorials / ASP 101 / Mix ASP with HTML

ASP 101: Mix ASP with HTML
By: Aaron B. Copyright AaronOutpost.com

 

    This is part 2 of 6 of ASP 101 by AaronOutpost.com. If you are unsure of what we may be talking about in the tutorial, view the previous parts.

So far we have created your first ASP page and we have defined a value and displayed it on the page. We are now going to take that exact same page and modify it. I am going to show you how to mix ASP with HTML.

Let's begin.

 

Part 2:
Mix ASP with HTML

START YOUR PAGES

Open your favorite text or HTML editor. It can be FrontPage, NotePad, FireWorks, Arachnophilia, etc... It don't matter.

Open first_asp_page_part1.asp, the file we created in the previous tutorial. Your code should look like this.

<html>

<head>

<title>My First ASP Page</title>

</head>

<body bgcolor="#FFFFFF" text="#000000" link="#003300" vlink="#006600" alink="#689577">

 

<%

'Dimension variables

Dim MyVariable 'Comment on what this variable holds

 

'Define a value for the MyVariable
MyVariable = "I am learning ASP! This is my first programmed variable!"

'Write line breaks into the web page
Response.Write ("<br><br>")

'Start a font tag and use double quotes
Response.Write ("<font face=""Arial"" size=""2"" color=""#000000"">")

'Write MyVariable to the web page
Response.Write (
MyVariable)

'End a font tag
Response.Write ("</font>")

'Close the server script
%>

  </body> </html>

 

HOW TO MIX ASP WITH HTML

You will notice that you can end the ASP script %> and go back to HTML. You can actually do this and still keep your stored variables.

Also, in the middle of html code you can enter ASP. Say you are in the middle of html code and you want to enter your value. Simply open ASP script, put and equals sign and then the variable. Of course end the asp script to return back to HTML.

<%= MyVariable) %>

 

 

 

Now knowing this, let's change our existing page to use more html and not the response.write function.

<html>

<head>

<title>My First ASP Page</title>

</head>

<body bgcolor="#FFFFFF" text="#000000" link="#003300" vlink="#006600" alink="#689577">

 

<%

'Dimension variables

Dim MyVariable 'Comment on what this variable holds

 

'Define a value for the MyVariable
MyVariable = "I am learning ASP! This is my first programmed variable!"
%>

<br><br>
<font face="Arial" size="2" color="#000000">
<%
= MyVariable %></font>

</body> </html>
 

CONGRATULATIONS!!!

Now, you have completed part 2 of 6 Learning ASP 101 by AaronOutpost.com.

Open Viewable Example
Continue to part 3: Date & Time Functions

 


AaronOutpost : ASP / Tutorials / ASP 101 / Mix ASP with HTML


Random_Image
News & Updates

ASP Inline Calendar 3.9 (January 5, 2008)
Future Home of News & Updates (January 5, 2008)

 

Photo Special

Schedule an appointment

Available in & around:
Centreville VA, Spotsylvania VA,
Summersville WV, & Charleston WV
.

  • NAME YOUR PRICE
    • Email your:
    • Event
    • Hours Needed
    • Photos Needed
    • Disks or Prints
    • and Price You're Willing To Pay
ASP Inline Calendar

$100 Installation Special

PROFESSIONAL INSTALLATION OF YOUR ASP INLINE CALENDAR. REDUCE THE HASSLE, LET US INSTALL YOUR ASP INLINE CALENDAR. SEND A FORMAL REQUEST FOR INSTALLATION WITH SERVER ACCESS INFORMATION. WE WILL NEED FTP ACCESS ALONG WITH CONTROL PANEL ACCESS.

Purchase A Calendar
Information
Demo
Ask A Question

User must provide ftp access to server. Installations are not guaranteed. We work with your service provider to get your calendar installed.

 

Centreville, VA      -      Spotsylvania, VA      -      Charleston, WV      -      Summersville, WV

© Copyright AaronOutpost.com 2010. All rights reserved.