ASP programming into the first step (5): Built-in object Response

xiaoxiao2021-03-06  39

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: