473,378 Members | 1,382 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,378 software developers and data experts.

Running ASP Code From a String

Can I run ASP code from a string? I thought of using this method to
get included files as text http://www.asp101.com/articles/micha...es/default.asp
but then I need to run it as ASP.
Thanks
Jun 27 '08 #1
6 2902
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.


"vunet" <vu******@gmail.comwrote in message news:15**********************************@f63g2000 hsf.googlegroups.com...
Can I run ASP code from a string? I thought of using this method to
get included files as text http://www.asp101.com/articles/micha...es/default.asp
but then I need to run it as ASP.
Thanks

Jun 27 '08 #2
On Jun 24, 12:51*pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
dot comwrote:
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.

"vunet" <vunet...@gmail.comwrote in messagenews:15**********************************@f 63g2000hsf.googlegroups.com...
Can I run ASP code from a string? I thought of using this method to
get included files as texthttp://www.asp101.com/articles/michael/dynamicincludes/default.asp
but then I need to run it as ASP.
Thanks
But what would it look like? I cannot execute ASP code as a string
because all ASP tags are not executed.
Jun 27 '08 #3
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>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 27 '08 #4
On Jun 24, 2:07*pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
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>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
If JSCRIPT is not supported can it be done in ASP/VBScript?
Jun 27 '08 #5
vunet wrote:
>
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.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 27 '08 #6
Bob Barrows [MVP] wrote on 24 jun 2008 in
microsoft.public.inetserver.asp.general:
vunet wrote:
>>
If JSCRIPT is not supported can it be done in ASP/VBScript?
? 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".

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 27 '08 #7

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

Similar topics

9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
4
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
3
by: Phil Stanton | last post by:
I have a number of queries which use code for the output of 1 or more fields. For example Address:GetAddress(AddressID, True, 60) Address ID Points to an Address in a table - Address Line1, Line...
4
by: =?Utf-8?B?UGhpbGlwIEs=?= | last post by:
Simplifying the code a bit its like this: try { myRemotingObj.Myfunction(string, string,string,string,timeSpan) } catch(WebException) { commsUp = false; }
1
by: BrianMiller | last post by:
I have searched for an answer but have failed to come up with anything that seems to work. I am trying to set up an Access 2003 database for home accounts. I want to create a running sum (a...
0
by: anoop23 | last post by:
Hi, Im running a timer to Unzip a zip file using a 'ICSharpCode.SharpZipLib.dll'. It works well when I block the main thread indefinitely by 'thread.sleep(-1)'. But gets an ThreadAbort...
4
lifeisgreat20009
by: lifeisgreat20009 | last post by:
This is what i am getting on running the program......... C:\PROGRA~1\Java\JDK15~1.0\bin>javac Editor.java Note: Editor.java uses or overrides a deprecated API. Note: Recompile with...
1
AHMEDYO
by: AHMEDYO | last post by:
Hi every one... This code simply show if your project running from VB6 IDE or running as single exe file, because visual basic 6.0 run your project within VB6.exe process and it doesn't create...
6
by: tvaughan77 | last post by:
Hi, I have some code that I want to use to run a command line utility and I want to be able to run it from an aspx page running under IIS. The command line utility is a local utility running on...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.