Hi folks,
Although I'm an experienced programmer, I'm new to ASP and relatively new to web programming, so I hope you'll be patient with my questions.
I'm working on a project using ASP.NET and C# for the server side code. I've written code to retrieve data from a database and put it into a dynamic html table for the user to view and edit. Works great. Now I want to save those changes and that's where I'm unsure how best to proceed.
I have a "Save Changes" button on the page that I want the user to use to indicate that they've finished making changes to the data and to store it back to the database. My initial intention is to have the click of this button call my server side C# code and it will scan the table, find what changed (if possible) and store it. If it can't necessarily tell what changed, that's okay as I can store all records regardless as it's only about 200 records.
First of all, is this really the way to do it? Or is there a smarter way to store changes back to the database?
Assuming my design is adequate, how is my server side code able to get to the records in this table on the client?
Also, I'm thinking of storing a hidden "dirty bit" on the client side for each row that changes (via JavaScript) and the "Save Changes" will scan through the table for those that have the dirty bit set and only save those. Is this feasible? Again, is there a smarter way to handle this?
Thanks for any advice anyone can give. I'm learning a lot about the limitations of web programming and the tricks of having to pass information between client and server. It makes things a bit more challenging, to be sure.
Robert Porter