最低価格と最高価格を示す 2 つのドロップダウン リストがあります。
RangeExpression を使用して、これら 2 つのドロップダウン リストの値の間のすべての製品範囲を別のページに表示したいと考えています。
どちらのドロップダウン リストもマスター ページにあります。送信ボタンをクリックすると、すべての製品がその価格帯内の別のページに表示されるはずです。
それで、私は何をすべきですか?それに渡すクエリ文字列として何を使用すればよいですか?
私はこれをしました:
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="linqextenderDataContext" EntityTypeName=""
TableName="Products" Where="Category == @Category">
<WhereParameters>
<asp:ControlParameter ControlID="dropcategory" Name="Category"
PropertyName="SelectedValue" Type="String" />
</WhereParameters>
</asp:LinqDataSource>
<asp:QueryExtender ID="QueryExtender1" runat="server"
TargetControlID="LinqDataSource1">
<asp:RangeExpression DataField="Price" MinType="Inclusive"
MaxType="Inclusive">
<asp:ControlParameter ControlID="dropmin" Type="Int32"
PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="dropmax" Type="Int32"
PropertyName="SelectedValue"/>
</asp:RangeExpression>
</asp:QueryExtender>
<asp:Button ID="btnsubmit" runat="server" Text="Submit"
style="margin-left:50px" onclick="btnsubmit_Click"/>
すべてのデータを別のページに表示したいので、別のページにリダイレクトするときに何を渡す必要がありますか?
protected void btnsubmit_Click(object sender, EventArgs e)
{
Response.Redirect("products.aspx");
}