Download presentation
Presentation is loading. Please wait.
Published byVerity Simmons Modified over 8 years ago
1
Server Object Server Object
2
The Server object represents a programmable interface to the HTTP service that provides a mechanism to administer and control the Web Server The Server object used four method to control aspects of Web server CreateObject MapPath HTMLEncodeURLEncode
3
Server Object CreateObject : Creates a Server instance of an object MapPath : Translates the Web’s Server virtual path setting to the physical path on the server. HTMLEncode : Utilizes HTML encoding to deliver text to browser. URLEncode : Utilizes URL encoding techniques.
4
CreateObject Method Create a connection to an instance of an ActiveX Object. This connection mechanism is based on the Common Object Mode(COM) COM provides the standard for objects to communicatewith one another
5
CreateObject Method The CreateObject method use the following syntax: Server.CreateObject(progID) –The progID also requires the following format appname.ObjectType
6
CreateObject Method ASP ships with five components that can be used immediately: –Database Object –AdRotator –Browser Component –Content Streaming Component –Server-Side Includes(SSI) component
7
MapPath Method The Server object uses the MapPath method to track and manage information on the server. The MapPath method requires the following syntax : Server.MapPath(path)
8
MapPath Method There are two basics rules to remember with path arguments. Path argument start with a backslash(\) or slash(/) are used to represent virtual directories. Path argument that do not start with a backslash or slash represent relative directories.
9
MapPath Method or return ==> C:\InetPub\wwwroot\Scripts or return ==> C:\InetPub\wwwroot
10
MapPath Method SalesIf the ASP file was run in the Sales directory. return ==> C:\Inetpub\wwwroot\Sales\Script s
11
URLEncode Method To ensure that all the characters entered by user are properly passed to the server. Server.URLEncode(string) Server.URLEncode(“Dave’s #1 Fan”) DAVE=%27s+%231+Fan
12
URLEncode Method The ERLEncode method performs the following processes to the data –Spaces are transformed into plus(+) symbol –Fields are left unencoded –An unencoded equal sign assigns an unencoded field name with the data value. –Non-ASCII characters are transformed into escape codes
13
HTMLEncode Method The HTMLEncode method is used by the server to explicity define the character to displayed to a page. Server.HTMLEncode(String) Server.HTMLEncode(“Table width=‘100%’”) <Table width=‘100%’>
14
Server Object Properties ScriptTimeOutThe Server Object has only one property is ScriptTimeOut. Used to set the amount of time the Server will process the ASP script before terminate the request. or
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.