generate Server Script at runtime

liunx

Guest
This is just a theorical question.

Is it possible to generate server script and excute it at runtime ?

Exemple: i send code as string from a form, then get the data and then construct the code and execute it and then the page load as normal...

Is there something similar to the eval() method in javascript ?

ThxYou can easily write out a client side script. You can write a server side script too, but it would be more difficult. You would have to write it into another file and use string functions. You are going to have to use some character codes too because if <script runat=server> is in your code twice, even if it is in " then you have an issue.Thanx PeOfEo,

So you are saying that it's possible to generate server script.

What would be the step for doing it. I am receiving data from a form, so in that file, process.aspx (the file that analyse and get the data from the form) i should:

1) construct the code i want using string passed to the form.
2) create a new file // Can i write code in a page already running on the server ? Like in process.aspx.
3) run that new file ...

Can you tell me if i am wrong ...

You see, i am trying do so beacause i am to much limited using client side script. (Javascript and Flash). Since i don't want to have a library of server script i'd rather wnat to use dynamicly generated code... Much Interesting...


Do you know where i can get more information on that topic or tutorial or exemple...

ThanxTake a look into System.CodeDom.Compiler I think you'll find a lot of what you'll be needing to use in there.
 
Back
Top