Here's my situation. I'm developing an ASP.NET (2.0) app for internal use. In it, I've got a number of pages with GridViews. I've included an option to export the data from the GridView to Excel (client-side using Javascript). The Excel workbook has 2 tabs - one tab is formatted like the GridView, the other tab contains the raw data. Everything works great and looks good from the client's standpoint. The issue is that the Javascript is pretty ugly.
When I fill my dataset with the data the GridView is bound to, I also build a delimited string that's used for the export. I store the delimited string in a HiddenField, and retrieve the value of the HiddenField when the export button is pressed. I have several different delimiters, and it generally has that hacked together feel. Is there a better way to store the data for export and is there a more standard method of storing it instead of a roll-your-own delimited string? I haven't dug into JSON yet. Is this the right path to go down?