473,569 Members | 2,991 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2914
You can execute a string but it has to be written correctly or the filesystemObjec t 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******** *************** ***********@f63 g2000hsf.google groups.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 filesystemObjec t 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* *************** *************** ***@f63g2000hsf .googlegroups.c om...
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.publi c.inetserver.as p.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='javas cript' 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.net wrote:
vunet wrote on 24 jun 2008 in microsoft.publi c.inetserver.as p.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='javas cript' 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.publi c.inetserver.as p.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
3259
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 problem occurs when i try to show a progress bar. The screen freezes. I know i'm not the first one to ask about it. but i'm looking
4
3969
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 but when he runs the stored procedure, he gets the following error message. "SYSPROC".CSGCSB54 - Run started. Data returned in result sets is...
3
2155
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 2, Line 3, Town, County, Post Code, Country. The True is whether to include the country and the 60 is the maximum line length (after which a line...
4
2121
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
2738
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 balance based on what has been spent or paid in). I have a table called tblCardBankPymnts. In that I have a Figure column for what transaction has been...
0
1305
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 Exception if i run the timer without thread blocking. How can i avoid this error?Im not using thread.abort anywhere in my code.My code to unzip file is...
4
2117
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 -Xlint:deprecation for details. I did run the program like this after compiling it using javac command......... I get this........
1
6850
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 new exe file for you like VB.NET, this situation make some problems as when you try to use resource with API call, all your functions will get failed. ...
6
2738
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 the same box as my IIS server, and the code works in Visual Studio, just not under IIS. Any suggestions? The logs are totally silent on the issue. ...
1
8121
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 file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.