2011-04-15 28 views
0

是否有可能讓QueryExtender使用RadioButtonList中的值來過濾結果?這是我目前的代碼:是否有可能與QueryExtender一起使用RadioButtonList?

<asp:QueryExtender ID="QueryExtender1" runat="server" TargetControlID="EntityDataSource1"> 
    <asp:PropertyExpression> 
     <asp:ControlParameter ControlID="rblFilter" Name="business_done" /> 
    </asp: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> 

底層數據字段是一個位值,我明白,實體框架將其解釋爲布爾值。

回答

1

這很簡單.. Here's a very nice article教你如何在C#實現這個和VB.NET

「ControlFilterExpression - 用於 過濾器基於在一個 特定的Web控件的值的字段頁面 (如TextBox或DropDownList)。「

相關問題