Monday, September 7, 2009

MVC Local Date Input Formatting

MVC Local Date Input Formatting

I've got an MVC app I'm writing that has several input dates in it. Obviously these may be submitted in different formats, depending on the users localisation detail so I need to convert these on the POST method prior to using the UpdateModel method to fire the results through to the data object and its validation code. I believe I should use a custom model binder for this, correct? If so, do I have to create a model binder for each field (they may not all be present on any particular form submission) or can I create one that will apply to all the different field names? Are there any good articles on doing this that anyone knows about (I would have thought this would be a common issue, but I am struggling to find an article that addresses it well).

Cheers

MH

View Full Details...............................

No comments:

Post a Comment