There’s just something fun about writing server side code, which in turn writes out client side script. I don’t know why, but it’s one of the tasks that brings me back to the magical feeling I felt the first time I saw the characters “Hello World” print out on a console.
The only part that isn’t fun is converting a complex script into a C# or VB.NET string expression. A little while back I wrote a web form to convert literals (incuding scripts) into expressions. I just posted the bits for the ConvertLiteralToExpression Library to GotDotNet in case you want to expand on it, or run your own.
I originally planned on writing this code as an excuse to learn about .NET’s CodeDom mechanism for dynamically generating code. However, when the quick mockup using string manipulation became part of my main toolkit, I lost interest.
Once I’ve ramped up a bit on Whidbey I may convert this to a VS.NET add-in…