I have db column string.
I can have multiple types of values stored in that field like a string or bool etc.
This column is bound using EditorFor as below :
@Html.EditorFor(s => item.PropertyValue, new
{
htmlAttributes = new
{
Name = item.ItemName ,
@type = item.DataType
}
})
Where DataType defines the type of data that this control holds.
When the data type is checkbox, and during the Post method, from the FormsCollection, how to retrive the value?
Had the following problems :
1. If EditorFor object is used, in case of check box value false, the key is not obtained in the forms collection list at all.
2. If CheckBox object is used , then it is retriving 2 values i.e like this "true,false"
How to have a Checkbox displayed in a view dynamically and be able to retrive its value on Post from the forms collection keys.
Can some body help me with this pls?