Last updated: August 26, 2026.
The ASP Server object supplies encoding, path mapping, component creation, execution, and error helpers.
Common safe uses
<%
Dim value, physicalPath
value = Request.QueryString("value")
physicalPath = Server.MapPath("/App_Data/report.txt")
Response.Write Server.HTMLEncode(value)
Response.Write "<br>Encoded URL: " & Server.URLEncode(value)
%>Important methods
| Method | Purpose |
|---|---|
HTMLEncode | Encode text for HTML output |
URLEncode | Encode a URL component |
MapPath | Map a virtual path to a physical path |
CreateObject | Create an installed COM component |
GetLastError | Read the current ASP error on an error page |
Use fixed virtual paths with MapPath and do not create component names or filesystem paths from request input.