error in Add Event in Caledar "String was not recognized as a valid DateTime."

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/3/2010 4:52:13 PM
Gravatar
Total Posts 3

error in Add Event in Caledar "String was not recognized as a valid DateTime."

SQL 2005 express on windows 7

the localization in Italian.

When I try to add event in event calendar i have an error.

Server Error in '/' Application.
--------------------------------------------------------------------------------

String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: String was not recognized as a valid DateTime.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +2845862
mojoPortal.Web.EventCalendarUI.EventCalendarEdit.btnUpdate_Click(Object sender, EventArgs e) +589
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Grazie

6/21/2010 5:30:15 AM
Gravatar
Total Posts 2

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

I get the same error with SQL Server 2008 Express on Windows 7, with mojoPortal version 2.3.4.3.

If I change localization to en-US I'm able to insert new events in the event calendar. Now events appears in the db table "mp_CalendarEvents" with italian format and turning back site localization to it-IT I can see events and events details without problems on pages.

It seems a problem on the way the portal is getting values from days calendar and time dropdowns and format them, because with US locale (e.g. time in AM/PM format in dropdown) the problem disappears.

If isn't possible to solve the bug via configuration I've to change browser localization every time I want insert new events :-(

Please help

6/21/2010 6:44:24 AM
Gravatar
Total Posts 18439

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi,

I cannot produce the error. I set my culture in Web.config like this to force Italian

<add key="UseCultureOverride" value="true" />
  <add key="site1culture" value="it-IT" />

The date picker formats as Italian:

italian datepicker screen shot

I get no error when I save it.

Best,

Joe

6/21/2010 7:01:33 AM
Gravatar
Total Posts 3

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

I modify key

<add key="UseCultureOverride" value="true" />
<add key="site1culture" value="it-IT" />

in web.config but the problem is not resolved.

I have Windows 7 (italian) and MS-SQL 2005 express.

6/21/2010 7:33:59 AM
Gravatar
Total Posts 2

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi Joe,

maybe the problem is the format in wich time intervals are displayed in dropdown lists.

In my case I have "hh.mm", instead of "hh:mm".

How are populated the dropdown time pickers? Why for the same culture we have different results?

Thanks

  

6/21/2010 7:42:54 AM
Gravatar
Total Posts 3

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

x giuseppe (in italiano) credo che il problema sia SQL o Windows 7. a me funziona male sono in questo caso.
Su un server 2003 (ing) con SQL 2005 expr fuziona tutto correttamente e mette hh.mm senza problemi.

x joe

I think the problem is SQL 2005 Express configuration or some settings in windows 7.
I have an istallation on Windows 2003 Server and SQL 2005 exp and it work fine. 

6/21/2010 9:09:44 AM
Gravatar
Total Posts 18439

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi,

It is very strange, the posted error is in .NET code, it does not seem to be anything related to the db

In my case I have "hh.mm", instead of "hh:mm".

That is strange, I would not expect it to behave different on different machines using the same culture.

It is populated like this:

DateTime tomorrow = thisDay.AddDays(1).AddMinutes(-15);
            ddStartTime.Items.Insert(0, new ListItem(thisDay.ToShortTimeString(), thisDay.ToShortTimeString()));
            ddEndTime.Items.Insert(0, new ListItem(thisDay.ToShortTimeString(), thisDay.ToShortTimeString()));
            int i = 0;
            while (thisDay < tomorrow)
            {
                i += 1;
                thisDay = thisDay.AddMinutes(15);

                ddStartTime.Items.Insert(i, new ListItem(thisDay.ToShortTimeString(), thisDay.ToShortTimeString()));
                ddEndTime.Items.Insert(i, new ListItem(thisDay.ToShortTimeString(), thisDay.ToShortTimeString()));

            }

so the format of .ToShortTimeString is controlled by the culture of the executing thread, I would not expect it to be different on different machines unless not running the same version of .NET or maybe not having all the windows updates or .NET service paks installed could be a factor.

There are lots of people using mojoPortal with Italian and I have never seen this issue reported before and since I cannot reporoduce the issue it must be something about your machine or environment.

Hope it helps,

Joe

10/17/2011 9:05:15 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi Joe,

We faced the same issue on a development PC, but it was not so critical as it wasn't a production site.

We never had this problem on other sites either hosted on our servers or by providers.... before today!.

I recently implemented a new production site hosted by an Italian well known provider (Aruba) where we succesfully implemented other mojoPortal saites which are wroking fine with Win + MSSQL.

This time I got the date format error.

In Event Calendar feature you can't enter any event because hh.mm is selectable only from the combobox and apparently it is expecting data formatted as hh:mm (I have to switch language on your browser or force the culture on web.config.

In Blog feature the error condition is more complex. The post date format is ok but the time is shown in hh.mm format.

  • If you leave the default time, the error message is triggered.
  • If you manually enter hh:mm time the post is accepted.
  • If you use the date-time picker the resulting time is still in hh.mm format but the post is accepted.

A the the moment I have two sites hosted by the same provider/platform with same culture settings.

One is working the other doesn't.

As the provider's user interface for web hosting and database services is rather poor what sholud I ask the provider's helpdesk to check and compare between the two sites to make the second site working like the orther one ?

Thanks.
Diego 

 

mojoPortal 2.3.6.7 MSSQL

Microsoft Windows NT 6.1.7601 Service Pack 1

ASP.NET v2.0.50727  'Partial Trust'

10/17/2011 12:08:47 PM
Gravatar
Total Posts 18439

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi Diego,

Without steps to produce the problem it is difficult to help and I have no guess why it works in one installation and not the other. You might look at whether you are using different versions of jQueryUI as that could be a factor in the difference with the date picker.

If you can provide steps to produce the error in Event Calendar I will look into it.

In general I would recommend updating to .NET 4 hosting and the .NET 4 package of mojoPortal.

Best,

Joe

10/21/2011 10:11:50 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi Joe,

I have updated my test site to mojoPortal 2.3.7.0 .net 3.5, then I switched IIS to .NET 4 integrated pipeline hosting and installed the .NET 4 package of mojoPortal.

I was testing the upgraded site but I noteced that HTML editor and jQuery datePicker disappeared.

I Open the Administration menu and clicked on Site Setting to change the HTML editor for the site and I got this Error.

2011-10-21 16:59:15,430 ERROR 192.168.3.120 - it-IT - /Admin/SiteSettings.aspx - mojoPortal.Web.Global - 192.168.3.120 /Admin/SiteSettings.aspx Referrer(http://mojoportal.effectiveweb.it/Admin/AdminMenu.aspx) useragent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) System.Web.HttpParseException (0x80004005): Tag server 'portal:SkinList' sconosciuto. ---> System.Web.HttpException (0x80004005): Tag server 'portal:SkinList' sconosciuto.    in System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)    in System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)    in System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)    in System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)    in System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)    in System.Web.UI.TemplateParser.ProcessException(Exception ex)    in System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)    in System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)

Did I miss anything in the upgrade process ??

Thanks

Diego

10/21/2011 10:16:44 AM
Gravatar
Total Posts 18439

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi Diego,

It sounds like you did not use the Web.config file that shipped with mojoPortal and you are missing a tag declaration in your Web.config file as well as some other settings related to the editors and jquery are probably not correct. You should use the Web.config that shipped with mojoPortal and restore any customizations such as machine key from your old one.

Note that you no longer have to maintain the <system.net.mail section because it is no longer used. Only the settings in user.config are used for email now.

Hope that helps,

Joe

10/21/2011 11:38:11 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

You are right! (as usual...) I copied the new package on the old site folder without removing the unused Web.net40.config file (the one I renamed by mistake to web.config).

Now that I have succesfully completed my first upgrade from .Net 3.5 to 4.0 the next step is to upgrad the hosted site and check whether the .NET 4.0 solves the DateTime format issue on that production server well.

I let you know.

Regards.

Diego

10/24/2011 2:51:42 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: error in Add Event in Caledar "String was not recognized as a valid DateTime."

Hi Joe,

I confirm that upgrading to .NET 4.0 solved the issue.

Thanks and regards.

Diego

You must sign in to post in the forums. This thread is closed to new posts.