asp.net 和 C#
在这里,我有来自 gridview 控件的列
当用户单击任一按钮时,我需要将 CaseID、CaseworkerID、EventDate 和 Code 的值传递给存储过程
但是我如何将多个参数传递给我的 onclick 方法????
<columns>
<asp:BoundField DataField="CaseID" HeaderText="CaseID" Visible = "False" />
<asp:BoundField DataField="caseworkerID" HeaderText="CwID" Visible = "False" />
<asp:BoundField DataField="CaseWorker" HeaderText="Case Worker" />
<asp:BoundField DataField="EventDate" HeaderText="Event Date" />
<asp:BoundField DataField="Code" HeaderText="Code" />
<asp:TemplateField HeaderText="ADD">
<ItemTemplate>
<asp:Button ID="AddUnit" runat="server" Text=" +1 " onserverclick="AddUnit_Click"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TotalUnits" HeaderText="Total Units" />
<asp:TemplateField HeaderText="DDT">
<ItemTemplate>
<asp:Button ID="DdtUnit" runat="server" Text=" -1 " onserverclick="DdtUnit_Click"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="EventType" HeaderText="Event Type" />
<asp:BoundField DataField="UnitCost" HeaderText="Unit Cost" />
<asp:BoundField DataField="TotalCost" HeaderText="Total Cost"/>
编辑:所以我现在有了这个
<ItemTemplate>
<asp:Button ID="AddUnit" runat="server" Text=" +1 "
CommandName="AddUnit"
CommandArgument='<%# Eval("CaseID")+ ";" + Eval("caseworkerID")+ ";" + Eval("EventDate")+ ";" + Eval("Code")%>'/>
</ItemTemplate>
这是一个好的开始