问题描述
我有多个行的GridView,每个人都有一个更新按钮,我需要当有人点击更新按钮通过2的值。
除了包装用逗号(过时和不优雅)分隔内部CommandArgument的论点,我将如何传递多个参数?
I have a gridview with multiple rows, each has a Update button and I need to pass 2 values when someone clicks on Update button. Aside from packing the arguments inside CommandArgument separated by commas (archaic and not elegant), how would I pass more than one argument?
<asp:LinkButton ID="UpdateButton" runat="server" CommandName="UpdateRow" CommandArgument="arg_value" Text="Update and Insert" OnCommand="CommandButton_Click" ></asp:LinkButton>
作为一个说明,该值不能从页面上的任何控件中检索,所以不提供任何设计解决方案。请专心问的问题。先谢谢了。
As a note, the values can't be retrieved from any controls on the page, so don't offer any design solutions. Please concentrate on the question asked. Thanks in advance.
推荐答案
四处看起来凯尔西是正确的了。
After poking around it looks like Kelsey is correct.
只要用逗号或东西,并把它分解,当你想使用它。
Just use a comma or something and split it when you want to consume it.
这篇关于通过CommandArgument在Asp.net传递按钮的多个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!