0

My form (Html.BeginForm) was submitting well, i added some records over the period of one month using this form.

Then i did some cleanup (i don't remember those cleanups :( ) and tested the form after some time and now it is not submitting with a date value.

I mean, there are some date fields associated with master and child models, if child's date fields are filled (no matter parent's date is filled or not), the form does not get submitted and if these are empty then it does provided this is the first attempt i.e. if i attempt first with filled dates and then with empty dates, submitting does not work. I have two validation summaries with excludePropertyErrors true and false, no error is shown.

I had custom date format, dd-MMM-yyyy, and respective unobtrusive validator as jQuery.validator.methods["date"]. The behavior is same after removing these on both IE and Chrome.

However, a sample form submitting to the same controller's action on the same view with a sample model depicting the same structure works fine !!!

How to troubleshooting this??

4

2 回答 2

0

Seems to me that the model binder is working correctly for your expected params, but that specific form is not passing in the values correctly (while your test form does).

These are the things your should try:

  1. Use the browser's built in network logger and see what your POST looks like
  2. Check the cAsE and spellnig of your variable names on the form (they should match your params/POCO on the action signature)

Hope this helps some.

于 2012-06-01T14:46:04.227 回答
0

Thanks BiffBaffBoff for compare the two. I figured out the problem by enhancing the sample model, controller and view, adding fields and validations one by one and finally got the issue. It was my authorization action attribute which was missing on one of the Remote validation action for date, my controller requires authorization.

Thank you all who tried to help me out, without even looking at single line of code.

于 2012-06-02T07:05:46.153 回答