开发者

How to bind bool? to RadioButton in ASP.net

开发者 https://www.devze.com 2023-01-12 01:27 出处:网络
I don\'t know how to bind nullable bo开发者_如何学Colean field to RadioButton in ASP.net. Following code works well for non-nullable field

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消