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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Strings of ASP Code

Status
Not open for further replies.

fpgiv

Programmer
Oct 1, 2003
91
0
0
US
Hi,
I'm trying to create an ASP page using VBScript that creates another ASP page when a user selects certain options. I'm reading the data into the newly created file fine, but I'm having problems sending the ASP code as strings. It flips out because of the: <%@ in the double quotes. Can anyone help please?
Thanks!

My code looks like this:
set FSO = Server.CreateObject(&quot;scripting.FileSystemObject&quot;)
temp=&quot;C:\temp.asp&quot;
set myFile=fso.CreateTextFile(temp, true)
myFile.Writeline(&quot;<%@ Language=VBScript %>&quot;)
 
try URLencode() ing the strings

_____________________________________________________________________
onpnt2.gif
[sub]
Hakuna matata!!
[/sub]
 
actually that prob won't recognize right in the following pages load.


thinking....

_____________________________________________________________________
onpnt2.gif
[sub]
Hakuna matata!!
[/sub]
 
Did you try to assign <%@Language=VBScript%> to a variable first? Then:
myFile.WriteLine myVariable
BTW...The language directive is not necessary for you asp page to work. In fact I read somewhere that it's beneficial (efficiency wise) to omit it (I can't remember why though).
 
efficiency on the declaratiopn of the language being vbscript I would imagine due to the default language specification for ASP being vbscript. if you then add the language directive in the page you in all are causing a action to be interpruted that does not indeed need be by the server. two events for what can be only one.



_____________________________________________________________________
onpnt2.gif
[sub]
Hakuna matata!!
[/sub]
 
it sure sounded good didn't it [wink]

_____________________________________________________________________
onpnt2.gif
[sub]
Hakuna matata!!
[/sub]
 
Thanks all! I took out the <%@ language specification, since it is redundant, and that solved the problem. I thought it still wouldn't compile though about the parts that were myFile.Writeline(&quot;<% Response.Write text %>&quot;) and it still doesn't, but I found out that if you split up the asp tags, it compiles fine. i.e. I made it so
myFile.Writeline(&quot;<% Response.Write text &quot;) was one line and myFile.Writeline(&quot; %>&quot;) was one another line. Thanks so much!
 
hi guys! may i chime in with the following?

myFile.Writeline(&quot;<&quot; & &quot;% Response.Write text %&quot; & &quot;>&quot;)

this is similar when you want to write some javascript to another page using javascript, where where you might do the following:

document.write('<scr' + 'ipt> ... </scr' + 'ipt>');



regards!
-f!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top