Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.write not working 1

Status
Not open for further replies.

alfordjj

MIS
Jul 23, 2003
80
US
Ok, this will probably win the stupidest question of the week contest, but here it goes...

I'm trying to write a web page that lists the files in a certain directory. The code works if I put it into a .vbs file (using msgbox instead of Response.Write), but fails in a .asp, .htm, or any other type of IE file. I'm not getting any errors, but simply a blank IE page.

Here is my code.

Code:
<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
<title>Test1.asp</title>
</head>
<body>
<%
	strDir = "\\Server\share\"
	Set FSO = CreateObject("Scripting.FileSystemObject")
	Set objDir = FSO.GetFolder(strDir)

	Response.Write("<tr>test")
	For Each aItem In objDir.Files
		response.write("<td><b>" & aItem & "</b></td>)
	Next
	Response.Write("</tr>")
	
%>
</body>
</html>

Thanks in advance for taking a look at this!!
 
You need the rest of the table: tr cannot exist by itself. Try adding a <table> after <body> and a </table> before </body>
 
Ooops, knew I had to be forgetting something. However, it still didn't work. I'm still getting a blank page.

Here is how the new code looks:

Code:
<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
<title>Test1.asp</title>
</head>
<body>
<%
	strDir = "\\server\share\"
	Set FSO = CreateObject("Scripting.FileSystemObject")
	Set objDir = FSO.GetFolder(strDir)
	
	Response.Write("<table>")
	Response.Write("<tr>")
	For Each aItem In objDir.Files
		response.write("<td><b>" & aItem & "</b></td>)
	Next
	Response.Write("</tr>")
	Response.Write("</Table>")
	
%>
</body>
</html>

This is residing on my PC, not the server. Do you think that could have anything to do with it?

Thanks for your help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top