简体   繁体   中英

Is it possible to get values with C# from a dynamically added row with Javascript?

I have a table and rows are added by users by clicking in a button. I do this with Javascript. But then I have to get the values with C# and add then to database. C# is mandatory. How can I do this?

Use AJAX to get/send the values from and to the server.

this link would help youjquery

Probably the best way to do this would be to use AJAX. Since you're already using JavaScript, it would be a simple matter of adding the service call at the finalization stage of the action to implement the database changes directly.

http://msdn.microsoft.com/en-us/library/aa479042.aspx

you can do it by using jquery & ajax if you dont want you can put all new values in new rows in a hidden field (with a proper structure) and read hidden field value in server side

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM