如何在模板字段中传递两个参数
问题描述:
我想在复选框字段中传递两个参数以返回值.
我用:
i want to pass two parameter for in the checkbox field for returning value.
i use :
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# subProgram((DataBinder.Eval(Container.DataItem, "bit_indicator") + ";"+Eval("id")))%>' />
背后的代码:
code behind:
protected Boolean subProgram(object str,string doc_id)
{
}
那么模板字段有什么问题..
它给了错误提示器...
plz helpppp
谢谢Brother....
so what is wrong in template field..
it gives errorr......
plz helpppp
Thanksssss Brother....
答
请像对待链接按钮一样使用CommandArgument
.以下是对复选框执行相同操作的提示:将命令参数传递给复选框 [ ^ ]
Use CommandArgument
as we do for linkbuttons. Here is a Tip to do the same for checkboxes: Passing command arguments to a checkbox[^]