I have created mvc widget controller with some decimal properties. Controller code is:
, Title =
, SectionName =
MapWidgetController : ControllerBase, IMapConfiguration
I then created some feather widget designer. Nothing complicated, just two inputs.
Now with the testing. I enter value like: 46.084162. I then click save and error pops up: Error! 46.084162 is not a valid value for Decimal. Ok, I presume because I have set Slovenian culture for backend I must write comma instead of dot. So, I write 46,084162 and save. Seams to work. I click page preview in editor(/Action/Preview/sl) and it seams to work.
I save(publish) page and go to url. The exception pops up: Input string was not in a correct format. Inner exception: 46.084162 is not a valid value for Decimal. The source of exception is Telerik.Sitefinity.Mvc.ControllerActionInvoker.DeserializeControllerProperties.
What can I do? The same error occures if I don't create designer and just use default "advanced" designer.
Changing backends culture isn't option because of date formats in all content editing pages.
Looking forward for reply, Niki
Update: I wrote custom TypeConverter and I watch CultureInfo value comes as attribute to ConvertTo: - On opening designer: Invariant language (LCID 127) - On opening preview: Invariant language (LCID 127) - On opening public page: null
I made a bug post at: www.sitefinity.com/.../wrong-deserialization-of-decimal-values-if-decimal-point-is-not-dot
I posted hackish solution there.