473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Output to a new window ???

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
Jul 19 '05 #1
1 4266
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','s omewhere.htm');</script>"
else
response.write "nice"
end if

%>

Ray at work

"Anthony Judd" <adsf@.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave | last post by:
I'm getting different results when I display a value in the Output window as opposed to the Immediate window. Why? Code to recreate problem: 'Purpose: Get different results from Output...
0
by: andrew | last post by:
i slipped and dragged the output window away and lost it. i've tried the usual menu "View --> Other Windows --> Output" and of course the "Ctrl-Alt-O" shortcut to get it back but it won;t return...
3
by: Progalex | last post by:
Hi everybody! I'm creating a very simple VB .NET application that needs to launch the command line ml.exe compiler. At the moment I'm redirecting ML's output to a text file and then my app...
9
by: David A. Beck | last post by:
When I do a debug.print("blabla") in VB (VS2005) it doesn't show up in the output window, what gives?
3
by: Jason | last post by:
I've got a simple program in which I just write something to the console output window, but when I compile and run the program, the output windows displays the output and closes right away. How do...
0
by: John Shell | last post by:
Hello, I have a client application written in VB (call it Client). It uses a COM DLL written in VC++ (call it Server). The Client's projects are all contained in one solution and the Server is...
1
by: =?Utf-8?B?U2luY2xhaXI=?= | last post by:
Hi everyone, it happened to my VS2002 that I can't see Output window. I selected view-other windows-output, but nothing happened. It is really nightmare to find errors after build process. No...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
The output window gets filled with stuff while I am debugging my app. Is there a way to programmatically clear the output window? I have read that there is currently no explicit method to do this...
5
by: davidpryce123 | last post by:
Hi I am an XLib programmer making a move to Windows and C#. To learn as much as I can I am planning to convert a program basic program across from XLib. I have spent the last few days with...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am using the following command to output my results to the Output window (for testing things out). Console.WriteLine ("Output") I'd like to clear the Output window of any previous output. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.