views:

100

answers:

0

I have an order form with a dropdown list of 4 membership levels and a dropdown list below it for selecting T-shirt sizes that go along with the memberships. All memberships come with a t-shirt except no. 4. The form validates in the aspx code client side that there is a value for Membership and a value for T-shirt size. But when membership package 4 is selected from the list, I want to not display the T-shirt size selector and instead display a "No T-shirt with this package" and set the Item value to "none".

I guess it's recommended to do this in the Code Behind, but it would be clearer to me not being a asp person to do it in the aspx page. I've seen conditionals in the aspx like this:

 <div> 

 <% if (BOOLEAN)
              {%>
               <div>
               (Product dropdown)
               </div>
               <div>
               (T-shirt size dropdown)
               </div>


                        <%} else {%>

                        <div>                          

                         No T-shirt with this option. 
                        </div>
                        [set value to "none"]
                        <%} %>
 </div>

There is a callback to the server when client chooses a product value, so could do this in Code Behind in the aspx.cs page, but again since I don't know C#, something like this would be clearer to understand for me. How do I get the current itemlist value and check it in the boolean? How to set the T-shirt list item value to "none"? Any other issues with this approach?