By learning to the Request object, you can understand that the Request object is the server side to obtain information about the client. But is the server and client interaction, is it still lacking the server-side sending information to the client? Object Response is for this responsibility. The object that is responsible for passing the information to the user is Response, which can dynamically respond to the client's request, and return the dynamically generated response result to the client browser. 1. The Write method in response.write is using the most frequent one. Write is written: writing the specified string to the current HTTP output. 1, Write.asp
<% response.write ("Hello, World" & "
") randomizerest "& rnd () &" Yes "& rnd () &"
"%> Response.write is the information displayed, can be used Contains, you can also write directly (note that there is space between Response.Write). Writing string information or HTML code is related, with quotation marks; the function or variable of the ASP itself is not required, directly. And regardless of string information, HTML code, function or variables, all of which are & numbers (for VBScript), which are random function RND (), which returns a value of less than 1 but greater than or equal to 0. It should be noted that the random number generator is initialized before calling the RND, and the random number generator is initialized, which has a system timer based seed. If Randomize is missing, the random seed cannot be continued. The following is an example of random function, resulting in a random background color effect:
Randomize 'First of all, Randomize generates a random seed
Suij = RND () 'then assumes the function value of the variable Suij
Suij = Replace (Suij, ".", "9") 'and then converts the variable Suij hypotiode symbol to the number 9
Suij = Left (suij, 6) 'The left 6 digits in the variable
Document.write "
" finally applied to the background colorscript>
[CTRL A All Select Tips: You can modify some code first, then press Run] Of course, the random integer of the specified range is generated, please use the following formula: int (Upperbound - Lowerbound 1) * RND LowerBound) Here, UpperBound It is the upper bound of this range, and LowerBound is the lower bound in this range.
Do unsteil choose = VBNO
Value = INT ((41 * RND) 60) 'Generates a random number between 60 and 100.
Msgbox Value
CHOOSE = MSGBOX ("Roll Again?", Vbyesno)
Loop
script> [CTRL A All Selection Tips: You can modify some code first, then press the run] Random function is very useful when doing the test system, of course, you can also use your own lottery, take a picture I will line it. Response.end This is a method commonly used in response, so that the web server stops processing scripts and returns current result, and the remaining content in the file will not be processed. Mainly on a multi-function ASP page, in order to let the program run to this, or the procedure is not required to display ... 2. End.asp
<% response.write now () RESPONSE.WRITE NOW () program execution display This end response.write rnd ()%> Three, response.clear This method is the main role to clear all HTML output in the buffer, but this method only clears Respond to the body without clearing the response title. The method and the end method are similar, and the end is the result of returning the above, while the CLEAR is clear the above execution, and then returns only the result of the following. 3, CLEAR.ASP
<% response.write now () response.clear 'above the program to this all cleared response.write rnd ()%> By following an example to take a closer look End and Clear4, end2clear.asp
<% filepath = request.serverVariables ("script_name") user = request.form ("username") PWD = Request.form ("password")%>