jquery - ModelState.isValid = false on production machine, true on development machine -


i'm using jquery jtable plugin crud table within asp.net mvc 3 application. running code on development machine works fine. when move code production server, cannot add new events/rows jtable keep getting error "form not valid!..." being triggered in controller if(!modelstate.isvalid).

so next grabbed errors modelstate modelstate.values.selectmany(v => v.errors) , put them json response, , why modelstate invalid: "errormessage=the value '15/08/2013 11:00:00' not valid timestamp."

so question is, why date-string okay development server invalid production?

also, model invalid created ef database first, haven't set dataannotations on own. seems default modelbinder doesn't work on production system.

could possibly due fact i'm using dd/mm/yy instead of mm/dd/yy? it's canadian way..

edit: ah ha! because of culture specific format, first tried fixing switching culture settings on production environment ca, still didn't fix it. next thing did added in line web.config within system.web portion <globalization requestencoding="utf-8" responseencoding="utf-8" culture="en-ca" uiculture="en-ca"/> , things working smoothly. hope helps somebody!

as mentioned in edit, found cause of , solution problem. caused error being thrown automatic binding of parameters, , reason having issues dates on production machine due locale settings (dd/mm/yy vs mm/dd/yy) on machine. fix, set computers region settings (in control panel), , added line web.config.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -