Can category model (example given below) be passed
public class Category {
public Guid Id { get; set; };
public String Title { get; set; }
}
using a select/option?
<select id="categories" name="Category">
<option value="Id">Text</option>
</select>
As far as I understand this will bind normally but excluding Title property?
EDIT
Viewmodel
public class EditProductModelView {
[Required] Category Category { get; set; }
// other properties
}
Controller
public ActionResult Edit(EditProductViewModel model) {
// controller logic
}
Thanks!
you could add a hidden input for the title value and fill it with options the data-title attribute value whenever the selection option changes