求教下asp.net中GridView的CommandArgument问题 在asp.net中对CommandArgument绑定,是不是只有在模板列中才能自己对CommandArgument绑定,但是在RowCommand事件中 由非模板列触发也可以获取到CommandArgument,请问下这样获取的CommandArgument又是什么,获取的是行号还是什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CommandArgument 你绑的什么就是什么 ID 名字都可以例如下面就是ID。 <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="studentEdit" CommandArgument='<%#Eval("studentID") %>'>Edit</asp:LinkButton> http://blog.csdn.net/czh4869623/article/details/7770745 参考。 refer : http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.button.commandargument%28v=vs.90%29.aspx 对于模板列中的绑定我会,我要问的是非模板列中CommandArgument的问题,在那里是不能自己写CommandArgument的吧,但是在CS代码中可以获取到,这个CommandArgument是什么呢 对于模板列中的绑定我会,我要问的是非模板列中CommandArgument的问题,在那里是不能自己写CommandArgument的吧,但是在CS代码中可以获取到,这个CommandArgument是什么呢就好比为是判断条件吧。例如一个button 你设置CommandArgument它为 del 在button 事件里面 执行的操作不是del就不执行 ,你看MSND解释就明白了http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.button.commandargument%28v=vs.90%29.aspx 对于模板列中的绑定我会,我要问的是非模板列中CommandArgument的问题,在那里是不能自己写CommandArgument的吧,但是在CS代码中可以获取到,这个CommandArgument是什么呢就好比为是判断条件吧。例如一个button 你设置CommandArgument它为 del 在button 事件里面 执行的操作不是del就不执行 ,你看MSND解释就明白了http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.button.commandargument%28v=vs.90%29.aspx我不是说CommandArgument是做什么用的,这些我都知道,对于listview,repeater的CommandArgument我用的都比较熟,但是在GridView中,非模板列不能绑定CommandArgument,可是在操作时可以获取到它的CommandArgument,我想问下,获取到的CommandArgument是什么,行号么 这个时候获取的CommandArgument应该是这一行的对象吧 web.config里自定义了 字符串 运行却提示错误 如何一次执行多条SQL语句? 未将对象引用设置到对象的实例。 如何在一次查询的时候返回多个结果集; 網站資料庫設計問題...歡迎討論.... 请教在WEBFORM的DATAGRID 里显示图片的代码? 刷新页面时 如何使Session失效 asp.net中excel的保存 datagrid 的问题 问一个关于Repeater控件的简单问题 highcharts 怎么在把生成的图片直接导进word TFS项目门户网站多文件上传失败
例如下面就是ID。
<asp:LinkButton ID="lbtnEdit" runat="server" CommandName="studentEdit" CommandArgument='<%#Eval("studentID") %>'>Edit</asp:LinkButton>
在button 事件里面 执行的操作不是del就不执行 ,你看MSND解释就明白了http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.button.commandargument%28v=vs.90%29.aspx
在button 事件里面 执行的操作不是del就不执行 ,你看MSND解释就明白了http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.button.commandargument%28v=vs.90%29.aspx
我不是说CommandArgument是做什么用的,这些我都知道,对于listview,repeater的CommandArgument我用的都比较熟,但是在GridView中,非模板列不能绑定CommandArgument,可是在操作时可以获取到它的CommandArgument,我想问下,获取到的CommandArgument是什么,行号么