I am using an Ajax.BeginForm for input and passing the Model to my action.
All the fields, including the hidden fields, are being sent. However, the date fields remain '{01/01/0001 00:00:00}'
Here is the setup.
Model
publicpartialclassPromotionDetail{
publicint Id {get;set; }
publicDateTime StartDate { get;set; }
publicDateTime EndDate { get;set; } }
Form
@model myplace.Model.PromotionDetail
@using (Ajax.BeginForm("AddProductDetails","CustomerPromotions",null,newAjaxOptions{
UpdateTargetId ="PromotionDetail",
InsertionMode =InsertionMode.Replace,
HttpMethod ="POST"}))
{
@Html.HiddenFor(model => model.StartDate)
@Html.HiddenFor(model => model.EndDate)
"some input @Html.TextBoxFor" }
All the input fields and other hidden fields have data returned in the Model.
Although StartDate and EndDate have the correct data at the time of render, they are not passed along with the Model when submitted.