Forum Home
Press F1
 
Thread ID: 65777 2006-01-30 09:34:00 ASP Help (Really Urgent) dwnz (5333) Press F1
Post ID Timestamp Content User
425518 2006-01-30 09:34:00 Hi,
Ok i have a problem. I am printing out an asp file using the file system object, and it works fine until it comes to the end where it has to print a %> at the bottom of the file. The problem is that it cancels the running ASP script and the whole thing stops...i have tried heaps of things and nothing working.

The biggest problem is that the product is meant to be out in 2 days

Any help would be cool.

Thanks
Daniel
dwnz (5333)
425519 2006-01-30 14:22:00 Either escape or encode the characters. Unfortunately I don't know ASP to offer any code to show you how to do it, but that's all you really have to do with any of these files that you want to output without breaking out of ASP.

Cheers,


KK
Kame (312)
425520 2006-01-30 17:57:00 I dont have much experance with ASP but the quick google research seems to indicate that you dont need the closing/last %.

The method of printing you are using maybe interpreting that closing % as an escape signal.

Try removing it check your script (make sure it still does want is intended) then try printing.

If I remember correctly the % is a shorthand method of telling the broswer the following is ASP code, I dont think you need a closing % at the end of the page only used in the enclosed example <%Page Language="VB"%>

I maybe completely wrong here but google research seems to support this

.
beama (111)
425521 2006-01-30 19:59:00 So you've got an ASP program that calls the file system object to display another ASP file? Since you're printing anything at all, I guess you modified the NTFS security.

I guess you and your customer knows these are a big red security "no-no's", in lots of ways.

Have you tried printing any other file, such as a text file? It may be a end print job / FF / file close problem.

Kame's advice also sounds reasonable.
kingdragonfly (309)
425522 2006-01-30 22:13:00 Hi,
It is for the setup for the product, and it will be deleted afterward so other people cant play around with it. I have tried using html characters, but that doesnt work.

The problem is is that the %> in the "" closes the running ASP script, leaving the lines below it doing nothing

Data = Data & "%>"
tsObject.Write CStr(data)
%>
dwnz (5333)
425523 2006-01-30 23:23:00 Data = Data & "%>"
tsObject.Write CStr(data)
%>
Try something like: (forward slash, backward slash? I forget which)

Data = Data & "/%>"
tsObject.Write CStr(data)
%>
Or maybe even single quotes

Data = Data & '%>'
tsObject.Write CStr(data)
%>

Sorry I don't know much about asp, but those might work.
mejobloggs (264)
425524 2006-01-30 23:28:00 Here's a HTML encoder
www.w3schools.com

For example, ">" becomes %0e
kingdragonfly (309)
425525 2006-02-01 10:05:00 Still no luck :( I think the problem is that it is writing out text, and it doesnt need any encoding etc....

Daniel
dwnz (5333)
1