Scripting language

A

avh

Hi,

I'have been looking for a simple scripting (interpreted) language to be run
within my ASP.NET pages.Syntax is of minor importance.
Although I find many options, all of these seem to first compile the script
and then run it and this gives trouble on my shared hosting account on which
my ASP.NET 2 runs in medium trust mode.

Anyone any idea's ?

Thank you,

Wim
 
P

Patrice

I would ask about the original problem. By design .NET runs compiled code so
I doubt this is a language issue.

ASP.NET 2 also have a variety of deployment option (from putting
pre-compiled to DLLs to having the code deployed on the fly).

Also it could be just a particular operation that is forbidden by the ISP
(don't they have some kind of support ?)

I would definitely explain the original problem. You :may want also to test
the simplest possible web form to see if the problem could come from
somewhere else than you thought...
 
M

Mark Rae

I'have been looking for a simple scripting (interpreted) language to be
run within my ASP.NET pages.Syntax is of minor importance.
Although I find many options, all of these seem to first compile the
script and then run it and this gives trouble on my shared hosting account
on which my ASP.NET 2 runs in medium trust mode.

Anyone any idea's ?

It's a little difficult unless you explain what you're trying to do
exactly...

By "scripting", do you mean VBScript...? If so, why on earth are you trying
to use that in ASP.NET...?

Please post some code...?
 
A

avh

Hi Mark,

What I'm trying to do is the following:
I would like a way to dynamically validate the input of a form post by
running a dynamic script (interpreted) at the server side.

As stated: all code I found on the internet first compiles the code to IL nd
then I get all kinds of security exceptions due to the medium trust model.

Wim
 
M

Mark Rae

What I'm trying to do is the following:
I would like a way to dynamically validate the input of a form post by
running a dynamic script (interpreted) at the server side.

Well, unless I'm way off here, you *appear* to have a fundamental
misunderstanding about ASP.NET... ASP.NET is not ASP - that fact that you're
even referring to "scripting language" here implies (to me, at any rate)
that you haven't quite grasped that...

Server-side code (e.g. C#, VB.NET etc) is not interpreted - it is compiled

Client-side code (e.g. JavaScript, VBScript etc) is interpreted...



You can do client-side validation in e.g. JavaScript:

<script type="text/javascript">

function validateForm()
{
if (document.getElementById('<%=MyTextBox.ClientID%>').value.length ==
0)
{
alert('MyTextBox cannot be blank');
return false;
}
}

</script>

<asp:Button ID="MyButton" runat="server" OnClick="MyButton_Click"
OnClientClick="return validateForm();" />




Or you can do server-side validation in e.g. C#:

protected void MyButton_Click(object sender, System.EventArgs e)
{
if (MyTextBox.Text.Length == 0)
{
ClientScript.RegisterStartupScript(GetType(), "validation",
"alert('MyTextBox cannot be blank);", true);
return;
}
}



As stated: all code I found on the internet first compiles the code to IL

Yes, well it will do - that's how ASP.NET works...
 
W

wl

Hi Mark,

You must have misunderstood me: I'm fully aware of what the differences are
between ASP and ASP.NET.
I know that ASP is server side SCRIPTING and that ASP.NET code (being it C#,
J#, VB.NET or whatever) is being compiled to IL before being executed
serverside...

What I am trying to do is to create an environment (ASP.NET application)
that allows a regular html form (no, not a webform) to be posted to a
ASP.NET page. One of the value/name pairs would contain some side of
scripting code that is being run by the asp.net page as soon as the html
form is posted.

Wim
 
P

Patrice

What is not allowed by the host ?
Basically :
- either the limit is not the dynamic compilation and you could perhaps
workaround this problem (for example not saving the compiled assembly ?).
How do you compile ? You could also save the code to App_Code so that it is
compiled by the server when needed ?
- else you could change the host if they can't fit your need
- do your own scripting engine ?
- or you could change your own approach

I would likely choose 3 for now. IMO posting code from a form that will be
compiled server code is really something that should be avoided.

You may want to explain what you are trying to do in case someone could
suggest an alternate approach to dynamic code compilation for achieving what
you are trying to do...


Good luck.
 

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
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top