简体   繁体   中英

How to save asp.net textbox values with one button click and use that data for another button click?

I have a table with a row that allows the user to insert data into two textboxes, and a asp.net button called insert to bind that row to the gridview. Within the table I have a gridview which shows all the data populated form SQL Server, and any inserted rows which could be one, or many insertions based on button clicks. Then I have a submit button to submit the changes to SQL SERVER DB.

For example, the user enters some data into 2 textboxes then hits the insert button which just inserts that row into the gridview. The user can either add more rows, or hit the submit button. If the user hits the submit button, a stored procedure happens based on how many rows have been inserted.

I am not understanding how to send data from one button event to another button event using C# back-end ASP.NET front-end?

我能想到的一种方法是在第一次插入存储IDENT_current之后,当您单击Submit按钮时,在存储过程中包括where子句,其中给定的id值大于IDENT_Current,这样存储过程中提到的所有效果都会在插入时发生数据。

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