GridView CommandName =" INSERT"不工作 [英] GridView CommandName = "INSERT" not working

查看:101
本文介绍了GridView CommandName =" INSERT"不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GridView数据绑定控件,并尝试从页脚模板插入一条记录,下面是我的代码快照: //i.stack.imgur.com/4cj0D.pngalt =在这里输入图片描述>



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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆