about 9 years ago
ASP stands for Active Server Pages. By using ASP built-in objects, we can get the information related to the web server, web pages in the web application etc. the built-in objects are categorized according to the information it contain.
Following are the built-in objects in cakePHP
Application object is used to share information between all users of application. In application more then one user can use that method at a time, so there is lock and unlock method so that multiple users can not use a property at same time.
Methods in Application object:-
E.g of Application object:-
<%
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application.Unlock
%>
This application page has been visited
<%= Application("NumVisits") %> times!
<%
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application.Unlock
%>
This application page has been visited
<%= Application("NumVisits") %> times!
Used to get the data that was sent by the client browser to the server.
Method in Request objects:-
E.g of Request object:-
Used to send information to the client.
Methods in Response objects:-
E.g of Response object:-
<%
If Len(Request.QueryString("name")) > 0 Then
Response.Cookies("name") = Request.QueryString("name")
End If
Response.Write "Welcome " & Server.HTMLEncode(Response.Cookies("name")) & "!"
%>
<%
If Len(Request.QueryString("name")) > 0 Then
Response.Cookies("name") = Request.QueryString("name")
End If
Response.Write "Welcome " & Server.HTMLEncode(Response.Cookies("name")) & "!"
%>
Methods and properties on the server are accessed by Server object. It also allows connection to the database.
Methods in Server object:-
E.g of Server object:-
<%
Dim oAdoCon, oAdoRec, oAdoStm, oCdoCon, oCdoMsg, oSciDic, oSciFsm, oMswAdr
Set oAdoCon = Server.CreateObject("ADODB.Connection")
Set oAdoRec = Server.CreateObject("ADODB.Recordset")
Set oAdoStm = Server.CreateObject("ADODB.Stream")
Set oCdoCon = Server.CreateObject("CDO.Configuration")
Set oCdoMsg = Server.CreateObject("CDO.Message")
Set oSciDic = Server.CreateObject("Scripting.Dictionary")
Set oSciFsm = Server.CreateObject("Scripting.FileSystemObject")
Set oMswAdr = Server.CreateObject("MSWC.AdRotator")
%>
<%
Dim oAdoCon, oAdoRec, oAdoStm, oCdoCon, oCdoMsg, oSciDic, oSciFsm, oMswAdr
Set oAdoCon = Server.CreateObject("ADODB.Connection")
Set oAdoRec = Server.CreateObject("ADODB.Recordset")
Set oAdoStm = Server.CreateObject("ADODB.Stream")
Set oCdoCon = Server.CreateObject("CDO.Configuration")
Set oCdoMsg = Server.CreateObject("CDO.Message")
Set oSciDic = Server.CreateObject("Scripting.Dictionary")
Set oSciFsm = Server.CreateObject("Scripting.FileSystemObject")
Set oMswAdr = Server.CreateObject("MSWC.AdRotator")
%>
Used to store information only needed for a particular visitor.
Methods in Session object:-
E.g of Session object:-
<%
If Len(Request.QueryString("name")) > 0 Then
Session("name") = Request.QueryString("name")
End If
Response.Write "Welcome " & Server.HTMLEncode(Session("name")) & "!"
%>
<%
If Len(Request.QueryString("name")) > 0 Then
Session("name") = Request.QueryString("name")
End If
Response.Write "Welcome " & Server.HTMLEncode(Session("name")) & "!"
%>
0 Comment(s)