简体   繁体   中英

GridView CommandName = “INSERT” not working

I am using GridView data bound control and trying to insert a record from the footer template, below is snapshot of my code:

在此处输入图片说明

The insert command doesn't seem to be working as expected. Insert button click does not do anything. However, if I have a delete button with CommandName="Delete" (with same markup), it works fine.

Does GridView not understand the "Insert" CommandName? Am I missing anything?

Thanks!

GridView in ASP.NET does not support insert operations. Lots of people have added a footer row and a button to that row to do the insert. example: http://geekswithblogs.net/casualjim/archive/2005/08/29/51360.aspx

My personal preference is to have a detailsview linked to the gridview and do inserts through the detailsview. It's not pretty but it works. the footer row solution is much nicer.

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