Output to a new window ???

A

Anthony Judd

The functions below read a file on the server and create a document on the
fly.
Can someone tell me if their is a way to open a new window via asp and
output the results of these functions to the page in that window.

Thanx heaps.

Sub createPage(template,st)

Set file = Server.CreateObject("Scripting.FileSystemObject")

If file.FileExists(template) Then

Set txt = file.OpenTextFile(template,1)
startfile = txt.ReadAll()
pos = InStr(LCase(startfile), "<content>")
startfile = Left(startfile, pos - 1)
txt.Close

Set txt2 = file.OpenTextFile(template,1)
txt2.Skip(pos + Len(st)- 1)
endfile = txt2.ReadAll()

Response.Write(startfile)
displayContent()
Response.Write(endfile)

Else

msg = "The specified file was not found !"

End If

Set file = Nothing
readFile = msg

End Sub

Private Sub displayContent()

Server.Execute ("page_content.asp")

End Sub
 
R

Ray at

You can't open a new window via ASP. You have to use client side code with
that. You can use ASP to return the client-side code of your choice
depending on your results.


<%
a = 1

If a = 1 then
response.write "<script
language=""javascript"">window.open('something','somewhere.htm');</script>"
else
response.write "nice"
end if

%>

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top