Export (0) Print
Expand All
23 out of 46 rated this helpful - Rate this topic

Response.Write Method

IIS 6.0

The Write method writes a specified string to the current HTTP output.

Write(
   variant
)
variant

The data to write. This parameter can be any data type supported by the VBScript VARIANT data type, including characters, strings, and integers. This value cannot contain the character combination %>; instead you should use the escape sequence %\>. The Web server translates the escape sequence when it processes the script.

This method has no return values.

The following example use the Response.Write method and HTML to send output to the client:


<H3 align=center>I just want to say <% Response.Write "Hello World.</H3><BR>" %>  
Your name is: <% Response.Write Request.QueryString("name") %> <BR> 

The following example uses <%= instead of Response.Write.


The date is: <%= Date %> <BR> 

The following example adds an HTML tag to the Web page output. Because the string returned by the Write method cannot contain the character combination %>, the escape %\> is used instead.


<% Response.Write "<TABLE WIDTH = 100%\>" %>  

The previous example produces the following output:


<TABLE WIDTH = 100%>  

Applies To

If you do not want to use the default language code page, output from Response.Write can be encoded using different code pages by setting @CodePage, Response.CodePage, Session.CodePage, or the AspCodePage metabase property. For more information, see the Response.CodePage and Response.Charset reference pages.

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.