Response| Program | object | Design Response object in ASP programming the main function is from browser End-to-end to the server to transfer data to the browser client, we know that the ASP script is executed on the server side, he did not output "value" function. To have the output "value", you must rely on the response object.
Here we will focus on some of the features that are most commonly used. That is, some of the functions that are often used in programming are as follows:
(1). Response.Write Send Message to Browser
(2). Response.End to effectively abort code
(3). Response.Redirect page Redirection
How do I use Response.Write to send information to a browser?
In the following response.asp is a program to send information to the client, in the program using a built-in function--dateadd, for this feature can refer to the following related documents:
Http://help.activeserverpages.com/iishelp/VBScript/htm/vbs90.htm.
Response.asp Program source code:
The following interfaces are implemented:
Figure 01:response.write Sending information to the browser
How can Response.End effectively abort the code?
The following is the source program that terminates a page operation with Response.End end.asp and the running interface after execution:
End.asp:
<title> end.asp </title> <body color = "#FFFFFF" ><%when = Now () tommorow = DATEADD ("D", 1, when) Twoweekslater = Date Add ("W", 2, when) Monthlater = DateAdd ("M", 1, when) Sixminuteslater = DateAdd ("n", 6, when) Sixhourslater = d Ateadd ("H", 6, when) Response.Write "Now Time: <b>" & When & "</b> <br>" Response.Write "one months from now: <b>" & Mo Nthlater & "</b> <br>" Response.endresponse.write "two weeks from now: <b> & twoweekslater & </b> <br>%> from now 6 seconds: <b> <%= sixminuteslater%> </b> <br> 6 hours from now: <b> <%= sixhourslater%> </b> <br>
Run this program, the execution interface is as follows:
Figure 02:end.asp Program Execution interface
A response.end statement is visible in the end.asp program: if there is no such statement, the following is the interface of the program after execution:
Figure 03: The execution interface of the Masked Respons.end statement in the program
This shows how response.end effectively stops code execution.