- Home /
Question by
pandemoniumsynd · Sep 12, 2012 at 09:51 PM ·
c#
Execute arbitrary javascript from C#
I would like to
string expression = "2+2";
public string evaluateExpresion(expression)
{
return executeJavascript(expression);
}
Debug.Log(evaluateExpression(expression);
How can I accomplish this?
Comment
Answer by DaveA · Sep 12, 2012 at 09:56 PM
http://msdn.microsoft.com/en-us/library/system.web.ui.databinder.eval(v=vs.85).aspx
Careful, don't let that be something a user can enter, they can construct very malicious codes you would be executing for them.
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Flip over an object (smooth transition) 3 Answers