Such work just makes no practical sense and won't allow you to get any good results. At the same time, everything is already done for you, in JavaScript. This is all you need. I explained nearly everything in my comment to the question, please see.
What's missing? Only one thing, the key JavaScript function which does it all. This is
eval
:
http://www.w3schools.com/jsref/jsref_eval.asp[
^].
Are you getting the idea?
And if you just need some exercise in ASP.NET, better do something else. :-)
—SA