<asp:Button ID="btnbl" runat="server" Text="Block"
CommandArgument='<%#Eval("id")+","+ Eval("block")%>'
CommandName="changebutton1" class="btn btn-primary btn-purple" />
如果eval(“ block”)== 1,是否有地方可以制作类,将类更改为class =“ btn btn-primary btn-purple disable”?
答案 0 :(得分:0)
在这里像?:
一样使用条件运算符class='<%# Convert.ToInt32(Eval("block")) == 1? "btn btn-primary btn-purple disabled" : "btn btn-primary btn-purple"%>'
Ex-
<asp:Button ID="btnbl" runat="server" Text="Block"
CommandArgument='<%#Eval("id")+","+ Eval("block")%>'
CommandName="changebutton1" class='<%# Convert.ToInt32(Eval("block")) == 1? "btn btn-primary btn-purple disabled" : "btn btn-primary btn-purple"%>' />
看看有帮助吗