</>
Skip to content
ASP lessons (15/40)

ASP — Server Objects

Response Object

<%
Response.Write("Hello")
Response.Buffer = True
Response.Clear
Response.End
Response.Redirect("page.asp")
Response.AddHeader "X-Custom", "value"
Response.ContentType = "text/html"
%>

Request Object

<%
' Form data
Request.Form("username")

' Query string
Request.QueryString("id")

' Server variables
Request.ServerVariables("REMOTE_ADDR")

' All form data
Request.TotalBytes
%>

Session Object

<%
Session("user") = "John"
Response.Write(Session("user"))
Session.Timeout = 30
Session.Abandon
%>

Application Object

<%
Application("counter") = 0
Response.Write(Application("counter"))
Application.Lock
Application("counter") = Application("counter") + 1
Application.Unlock
%>

Server Object

<%
' Execute another page
Server.Execute("other.asp")

' Transfer to another page
Server.Transfer("other.asp")

' Map path
Server.MapPath("/images")

' URL encode
Response.Write(Server.URLEncode("Hello World"))

' Create object
Set obj = Server.CreateObject("Scripting.FileSystemObject")
%>

Object Methods

ObjectPurpose
ResponseSend data to client
RequestGet data from client
SessionPer-user data
ApplicationAll users data
ServerServer utilities

Mini Practice

  1. Use Response.Write
  2. Get form data
  3. Use Session
  4. Use Server.MapPath

Up Next

Continue with Request Object — request object details.

Related Topics

Frequently Asked Questions about Server Objects

What is Server Objects in ASP?

Server Objects is a fundamental concept in ASP. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Server Objects?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Server Objects.

Why is Server Objects important in ASP?

Server Objects is essential for ASP development. Understanding this concept will help you write better code and solve real-world problems more effectively.