Hi I'm a bit confused on using the case statement and if I should even be using it for this purpose?
I have 2 dropdowns in different Template sections being pulled from a database. I want to have the second dropdown only display the cities relating to the countryID in the first dropdown, the country values are 6, 7 and 8. The code below works for only showing item 6 on the second dropdown but when I change the country dropdown it does nothing to the city dropdown (yes I know I'm only creating 1 case but adding others seems to do nothing):
<xmod:Template UsePaging="False" Ajax="False">
<ListDataSource CommandText="SELECT id, countryName FROM country ORDER BY countryName ASC" ConnectionString='[[ConnectionString:Excursions]]'/>
<HeaderTemplate>
<label>Country: </label>
<select id="ddl-country">
<option value=""></option>
</HeaderTemplate>
<ItemTemplate>
<option value="[[id]]">[[countryName]] | id = [[id]]</option>
</ItemTemplate>
<FooterTemplate>
</select>
</FooterTemplate>
</xmod:Template>
<xmod:Template id="city" UsePaging="False" Ajax="False">
<ListDataSource CommandText="SELECT countryID, cityName FROM city" ConnectionString='[[ConnectionString:Excursions]]'>
</ListDataSource>
<HeaderTemplate>
<label>City: </label>
<select id="ddl-city">
</HeaderTemplate>
<ItemTemplate>
<xmod:Select>
<case comparetype="numeric" operator="=" value='[[countryID]]' expression="6" ignorecase="true">
<option value="[[countryID]]">[[cityName]] | id = [[countryID]]</option>
</case>
<else>
<p>blah</p>
</else>
</xmod:Select>
</ItemTemplate>
<FooterTemplate>
</select>
</FooterTemplate>
</xmod:Template>
Any help is appreciated.