To reproduce problem
1. Create controller
I have created mvc widget controller with some decimal properties. Controller code is:
, Title =
, SectionName =
MapWidgetController : ControllerBase, IMapConfiguration
2. Using widget designer : 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 should write comma instead of dot. So, I wrote 46,084162 and saved. Seams to work. I click page preview in editor(/Action/Preview/sl) and it seams to work. 3. 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.
To debug problem 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
The only hackish solution I found is writing custom typeconverter and using this code in ConvertTo and ConvertFrom methods.
item = HttpContext.Current.Items[
isDesignMode = item !=
culture = isDesignMode ? CultureInfo.CurrentCulture : CultureInfo.InvariantCulture;