PDA

View Full Version : ASP Help (Really Urgent)



dwnz
30-01-2006, 10:34 PM
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

Kame
31-01-2006, 03:22 AM
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

beama
31-01-2006, 06:57 AM
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

.

kingdragonfly
31-01-2006, 08:59 AM
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.

dwnz
31-01-2006, 11:13 AM
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)
%>

mejobloggs
31-01-2006, 12:23 PM
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.

kingdragonfly
31-01-2006, 12:28 PM
Here's a HTML encoder
http://www.w3schools.com/tags/ref_urlencode.asp

For example, ">" becomes %0e

dwnz
01-02-2006, 11:05 PM
Still no luck :( I think the problem is that it is writing out text, and it doesnt need any encoding etc....

Daniel