2

This is my code:

@using (Ajax.BeginForm(new AjaxOptions()))
{
    <fieldset>
        <legend>ManageOvertimesViewModel</legend>
        <div>
            @Html.LabelFor(model => model.Overtime.StartDate)
            @Html.EditorFor(model => model.Overtime.StartDate)
        </div>
        <p>
            <input id="Submit1" type="submit" value="submit" />
        </p>
    </fieldset>

If I comment out the two lines begins with @Html. then it works. Anyway the submit button doesn't make Ajax post.

dvjanm
  • 2,351
  • 1
  • 28
  • 42
  • try using an ajax post back to the controller. see my answer here http://stackoverflow.com/questions/19359204/asp-net-mvc-4-passing-object-variable-through-actionlink/19360998#19360998 – Matt Bodily Oct 14 '13 at 13:13
  • I found out what was the problem. I was a little inattentive. The reason is that @Html.EditorFor(model => model.Overtime.StartDate) is validated by jquery.validate* and the Date format was not good, but I didn't notice, because I removed the validation message :) – dvjanm Oct 14 '13 at 13:45

0 Answers0