Open In App

ASP Write() Method

Last Updated : 16 Sep, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

The ASP Write() method is used to display a string as an output on the webpage. It is a predefined method of the Response and Textstream type object.

Syntax:

For response object:

Response.Write variant

For Textstream Object: 

Textstream.write(string)

Parameter Values: This method contains the value i.e variant which represents the specified string that you want to display as an Output.

Return Values: This method does not return any Values.

Example: Below code illustrates the ASP Write() Method

ASP




<%
response.write("<h1>ASP Write() Method</h2>")
response.write("
<p>Hello GeeksForGeeks)</p>
")
%>


Example 2:

ASP




<%
name="GeeksForGeeks"
Response.Write(name)
%>


Example-3: Below code illustrates the ASP Write Method. 

ASP




<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("d:\GFG.txt",true)
f.write("Hello GeeksForGeeks")
f
f.close
set f=nothing
set fs=nothing
%>


Output 

Hello GeeksForGeeks


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads