VS 2008 Express, ASP.Net, VB.Net, Wesbsite Page, Experience Beginner
===================================================
I am trying to get a dropdown, with static values, to filter (select the where statement) DataList results.
I can get the dropdown to filter by a specific category, but have not been able to get any results when selecting ‘ALL CATEGORIES’
I don’t know what the dropdown value should be to return all category results when using the dropdown. If someone would be so kind to help, what should the following line of code look like to return all the results?
<asp:ListItem Value="*">All Categories</asp:ListItem>
Thank you.
Mike
Here’s an example of the code:
[CODE]
<tr>
<td class="tableTwoMainBody"> qq<br />
<asp:DropDownList ID="ddAscDesc" runat="server" AutoPostBack="True">
<asp:ListItem Value="ListPrice asc">List Price Ascending</asp:ListItem>
<asp:ListItem Value="ListPrice desc">List Price Descending</asp:ListItem>
</asp:DropDownList>
qq
<asp:DropDownList ID="ddPropCat" runat="server" AutoPostBack="True">
**THIS LINE <asp:ListItem Value="*">All Categories</asp:ListItem>
<asp:ListItem>Single Family</asp:ListItem>
<asp:ListItem>Cottage/Rec Properties</asp:ListItem>
<asp:ListItem>Condominiums</asp:ListItem>
<asp:ListItem>Fractional Ownership</asp:ListItem>
<asp:ListItem>Mobile/Mini</asp:ListItem>
<asp:ListItem>Vacant Lot(s)</asp:ListItem>
<asp:ListItem>Acreages</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</td>
</tr>
<td class="tableTwoMainBody">
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="ListingTableClassesDataContext"
Select="new (ListPrice, Photo1, ListingAddr1, ListingCity, reserveState, Photo1Caption, CustViewShortDesc, ViewNowLink, PropCategory, Bedrooms, FullBathrooms, HalfBathrooms, ListingID)"
TableName="Listings" OrderBy="ListPrice" Where="PropCategory == @PropCategory">
<OrderByParameters>
<asp:ControlParameter ControlID="ddAscDesc" Name="newparameter"
PropertyName="SelectedValue" />
</OrderByParameters>
<WhereParameters>
<asp:ControlParameter ControlID="ddPropCat" Name="PropCategory"
PropertyName="SelectedValue" Type="String" />
</WhereParameters>
</asp:LinqDataSource>
<asp:DataList ID="DataList1" runat="server" DataSourceID="LinqDataSource1">
<ItemTemplate>