GridView CommandName =" INSERT"不工作 [英] GridView CommandName = "INSERT" not working
问题描述
我使用GridView数据绑定控件,并尝试从页脚模板插入一条记录,下面是我的代码快照:
insert命令似乎没有像预期的那样工作。插入按钮单击不会执行任何操作。但是,如果我有一个删除按钮CommandName =删除(具有相同的标记),它工作正常。
GridView不理解插入命令名?我错过了什么?
谢谢!
.NET不支持插入操作。很多人在该行添加了一个页脚行和一个按钮来完成插入操作。例如: http://geekswithblogs.net/casualjim/archive/2005/08 /29/51360.aspx
我的个人偏好是将detailview链接到gridview,并通过detailsview插入。它不漂亮,但它的工作原理。页脚行解决方案更好。
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.
这篇关于GridView CommandName =" INSERT"不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!