Um Ausgang vom Bediener zu schicken dem Benutzer, wird der Asp Wartegegenstand benutzt.
Wartegegenstand
Um Ausgang vom Bediener zu schicken dem Benutzer, wird der Asp Wartegegenstand benutzt. Seine Ansammlungen, Eigenschaften und Methoden sind unten beschrieben:
Ansammlungen:
Collection
Description
Cookies
Sets a cookie value. If the cookie does not exist, it will be created, and take the value that is specified
Eigenschaften
Property
Description
Buffer
Specifies whether to buffer the page output or not
CacheControl
Sets whether a proxy server can cache the output generated by ASP or not
Charset
Appends the name of a character-set to the content-type header in the Response object
ContentType
Sets the HTTP content type for the Response object
Expires
Sets how long (in minutes) a page will be cached on a browser before it expires
ExpiresAbsolute
Sets a date and time when a page cached on a browser will expire
IsClientConnected
Indicates if the client has disconnected from the server
Pics
Appends a value to the PICS label response header
Status
Specifies the value of the status line returned by the server
Methoden
Method
Description
AddHeader
Adds a new HTTP header and a value to the HTTP response
AppendToLog
Adds a string to the end of the server log entry
BinaryWrite
Writes data directly to the output without any character conversion
Clear
Clears any buffered HTML output
End
Stops processing a script, and returns the current result
Flush
Sends buffered HTML output immediately
Redirect
Redirects the user to a different URL
Write
Writes a specified string to the output
Text mit Asp schreiben
<html>
<body>
<%
response.write("Hello World!")
%>
</body>
</html>
O/P:
Hello World!
Formattext mit HTML Umbauten in Asp
<html>
<body>
<%
response.write("<h2>You can use HTML tags to format the text!</h2>")
%>
<%
response.write("<p style='color:#0000ff'>This text is styled with the style
attribute!</p>")
%>
</body>
</html>
O/P:
You can use HTML tags to format the text!
This text is styled with the style attribute!
Den Benutzer zu einem anderen URL umadressieren
<%
if Request.Form("select")<>"" then
Response.Redirect(Request.Form("select"))
end if
%>
<html>
<body>
<form action="demo_redirect.asp" method="post">
<input type="radio" name="select"
value="demo_server.asp">
Server Example<br>
<input type="radio" name="select"
value="demo_text.asp">
Text Example<br><br>
<input type="submit" value="Go!">
</form>
</body>
</html>
O/P:
Server
Example
Text Example
Demonstriert den Gebrauch von der schreibenmethode. Zur Datenbanksuchroutine schreiben.
<%@ Language=VBScript%>
<% strFileTitle = "Writing"%>
<%ifnotLCase(Request.QueryString("PageView")) = "source" then%>
<%ShowHeader strFileTitle%>
<%<
Response.Write "<HTML>"
Response.Write "<HEAD>"
Response.Write "<META NAME=""GENERATOR"" Content=""Microsoft Visual Studio 6.0"">"
Response.Write "</HEAD>"
Response.Write "<BODY>"
Response.Write "This example is done completely using Response.Write statement.<BR><BR>"
Response.Write "If you need to produce quotation marks you use """
Response.Write "</BODY>"
Response.Write "</HTML>"
ShowFooter
%>
O/P:
This example is done completely using Response.Write statement.