Running ASP Code From a String

V

vunet

You can execute a string but it has to be written correctly or the filesystemObject will read the file into a string but then use
regular server-side includes to run the file.

But what would it look like? I cannot execute ASP code as a string
because all ASP tags are not executed.
 
E

Evertjan.

vunet wrote on 24 jun 2008 in microsoft.public.inetserver.asp.general:
But what would it look like? I cannot execute ASP code as a string
because all ASP tags are not executed.

What are ASP-tags?
What is ASP-code?
Asp is a platform, not a language.
"From a string" and "as a string" is not the same.

===========================

I would not advice it, but it is possible:

<script language='javascript' runat='server'>

var myString = 'Response.write("Hello World")';
eval(myString);

</script>
 
V

vunet

vunet wrote on 24 jun 2008 in microsoft.public.inetserver.asp.general:


What are ASP-tags?
What is ASP-code?
Asp is a platform, not a language.
"From a string" and "as a string" is not the same.

===========================

I would not advice it, but it is possible:

<script language='javascript' runat='server'>

var myString = 'Response.write("Hello World")';
eval(myString);

</script>

If JSCRIPT is not supported can it be done in ASP/VBScript?
 
B

Bob Barrows [MVP]

vunet said:
If JSCRIPT is not supported can it be done in ASP/VBScript?
? ASP/JSCRIPT is supported
You can use the Execute statement in VBSCRIPT. It's not something I
would recommend doing but people do use it.
 
E

Evertjan.

Bob Barrows [MVP] wrote on 24 jun 2008 in
microsoft.public.inetserver.asp.general:
? ASP/JSCRIPT is supported

I don't know if it is supported on all "non native" ASP use,
like ASP emulation for linux.

It is on MS-window platforms.
You can use the Execute statement in VBSCRIPT. It's not something I
would recommend doing but people do use it.

I would not recommend executing a string either in ASP/VB or in ASP/JS,
because the only logical reason to do it, is when getting such string from
clientside, which would be extremely dangerous.

Using ASP/JS als an alternative to ASP/VB in general I strongly recommend,
as it is pleasing to the mind to use a slightly more demanding language.
I know Bob and I disagree on this.

My giving this example of JS in this thread was simply ment to discourage
using "ASP-code" for "ASP-VB-code".
 

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
474,260
Messages
2,571,039
Members
48,768
Latest member
first4landlord

Latest Threads

Top