I’ve seen this question a few times but they mostly have to do with individual objects and cookies. I am building an application with a toolbox drag and drop functionality (very much like you’d see in Visual Studio – i.e. dragging objects onto a form, giving them a name, etc…) Therefore the droppable area could have many objects including nested droppables.
Any opinions on what is the best way to save to a SQL Server database, and then re-load such a complex layout? Objects would need to load and display exactly as they were saved. It will be done by ajax but beyond that I’m not sure the best way to proceed. Also any examples that might point me in the right direction would be great.
Much obliged.
You can serialize the data via XML or JSON and save the serialized string into the database. This would keep your database and web service infrastructure simple than having to save each control separately but would require more parsing on the JS side, but since your app sounds JS-heavy, I am assuming that shouldn’t be a problem for you.
JSON.stringifyis only on modern browsers but there are plenty of alternatives around if you are targeting older stuff.