I want to make an asp page where the user will upload a csv file which will be displayed dynamically, giving the user two options – to accept or reject the displayed table. If the user clicks on accept, the excel (csv) file should be updated to the database directly.
I have already done the following things:
- the csv file is uploaded successfully and the table is displayed dynamically.
- reject button, which will reject the uploaded file and refresh the page.
I need your help to achieve this:
Use an ajax script in a function called update() which will use the xmlhttp object to link all the parameters (columns of the table) and pass it on to a asp file which contains the code to update the database.
I hope you get the idea. Any help will be appreciated.
Use jQuery Ajax functions to achieve your desired effect. You can also write your on ajax functions in pure javascript.
You can find details about it: http://api.jquery.com/jQuery.ajax/