help.axcms.netAxinom Logo
Save Save Chapter Send Feedback
KB10012: FormatException: String was not recognized as a valid DateTime Exception at VotingModule
If the user is running under a different culture than the server and thus when the date is parsed in the user's session, an exception may occur while using Voting Module

SYMPTOMS

When using Voting Module, following excpetion is thrown:

[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +2271698
System.DateTime.Parse(String s, IFormatProvider provider) +26
System.Convert.ToDateTime(String value) +86
VotingModule.BL.VotingModul.get_ValidFromDateTime() +14
VotingModule.BL.VotingModul.get_VotingEnded() +122
VotingModule.BL.VotingModul.StartUp() +220
VotingModule.BL.VotingModul.Page_Load(Object sender, EventArgs e) +5
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

CAUSE

It was a bug in Voting Module:

The user is running under a different culture than the server and thus when the date is parsed in the user's session, a different date format is used, which results in failure.

SOLUTION

Upgrade to Premium Sample delivered with AxCMS.net version 9.0 or higher.

Workarounds:

  • If possible in your deployment scenario, you can ask your users to use a common system culture (you can specify it in the Regional and Language options Control Panel).
  • In your web.config files go to the 'globalization' section and set the culture and uiculture fields to whatever your language is. So in our case it was en-AU. (Unfortunately this workaround probably wont work for cross-cultural sites)

MORE INFORMATION

http://en.help.axinom.de/en_help_modules_votingmodule.AxCMS

APPLIES TO

AxCMS versions: before 9.0