开发者

Is it possible to use a RadioButtonList with QueryExtender?

Is it possible to have a QueryExtender use a value from a RadioButtonList to filter results? Here is my current code:

<asp:QueryExtender ID="QueryExtender1" runat="server" TargetControlID="EntityDataSource1">
    <asp:PropertyExpression>
        <asp:ControlParameter ControlID="rblFilter" Name="business_done" />
    </asp开发者_如何学C:PropertyExpression>
</asp:QueryExtender>
<asp:RadioButtonList ID="rblFilter" runat="server" 
    RepeatDirection="Horizontal" DataValueField="" AutoPostBack="True">
    <asp:ListItem Value="1">Yes</asp:ListItem>
    <asp:ListItem Value="0">No</asp:ListItem>
    <asp:ListItem>All</asp:ListItem>
</asp:RadioButtonList>

The underlying data field is a bit value, and I understand that Entity Framework interprets this as boolean.


That's easy .. Here's a very nice article that teach you how to achieve this in both C# and VB.NET

"ControlFilterExpression - used to filter a field based on the value of a particular Web control on the page (such as a TextBox or DropDownList)."

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜