I am building an application that is very similar to a shopping cart. The user selects a product from a list, and then based on that product, a few properties need to be set an
You can have a Product class with a collection of product properties
public class Product
{
private Dictionary properties;
///
/// Gets or sets the name.
///
/// The name.
public string Name
{
get;
set;
}
///
/// Gets or sets the price.
///
/// The price.
public double Price
{
get;
set;
}
public Dictionary Properties
{
get;
}
public Product()
{
properties = new Dictionary();
}
}
In the datasource you can have a table that defines the properties to each type of product. Then when you render the page you know what properties to show and the name to give in the dictionary.