How to bind bool? to RadioButton in ASP.net
I don't know how to bind nullable bo开发者_如何学Colean field to RadioButton in ASP.net.
Following code works well for non-nullable field
<asp:RadioButton ID="rbStatus" runat="server" Text="Accepted" Checked='<%# Bind("Status") %>' />
Can you tell me how I can bind nullable boolean field to RadioButton?
Thanks in advance
That's impossible, unfortunately you can use the Bind()
syntax only on non-nullable values. Bind is fairly limited in what it accepts for arguments. Unlike DataBinder.Eval
which is simply a method call.
精彩评论