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:


Line 25:         if (t.HasValue("category"))
Line 26:         {
Line 27:             var dates = Utility.DateSearch(t, Request.QueryString["startDate"], Request.QueryString["endDate"]);
Line 28: 
Line 29:             return dates.Count > 0 && DateTime.Today <= dates.Max();

Source File: C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\MacroPartials\EventsCategories.cshtml    Line: 27

Stack Trace:


[FormatException: String was not recognized as a valid DateTime.]
   System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +14545182
   System.Convert.ToDateTime(String value) +80
   Utility.DateSearch(IPublishedContent item, String startDate, String endDate) +1595
   ASP._Page_Views_MacroPartials_EventsCategories_cshtml.<Execute>b__3_2(IPublishedContent t) in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\MacroPartials\EventsCategories.cshtml:27
   System.Linq.WhereEnumerableIterator`1.MoveNext() +198
   ASP._Page_Views_MacroPartials_EventsCategories_cshtml.Execute() in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\MacroPartials\EventsCategories.cshtml:35
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in d:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult) in d:\a\1\s\src\Umbraco.Web\Mvc\ControllerExtensions.cs:80
   Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content) in d:\a\1\s\src\Umbraco.Web\Macros\PartialViewMacroEngine.cs:98
   Umbraco.Web.Macros.<>c__DisplayClass17_0.<ExecuteMacroOfType>b__0() in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:335
   Umbraco.Web.Macros.MacroRenderer.ExecuteProfileMacroWithErrorWrapper(MacroModel macro, String msgIn, Func`1 getMacroContent, Func`1 msgErr) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:306
   Umbraco.Web.Macros.MacroRenderer.ExecuteMacroWithErrorWrapper(MacroModel macro, String msgIn, String msgOut, Func`1 getMacroContent, Func`1 msgErr) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:265
   Umbraco.Web.Macros.MacroRenderer.ExecuteMacroOfType(MacroModel model, IPublishedContent content) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:332
   Umbraco.Web.Macros.MacroRenderer.Render(MacroModel macro, IPublishedContent content, IDictionary pageElements) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:238
   Umbraco.Web.UmbracoComponentRenderer.RenderMacro(IPublishedContent content, String alias, IDictionary`2 parameters) in d:\a\1\s\src\Umbraco.Web\UmbracoComponentRenderer.cs:131
   Umbraco.Web.UmbracoComponentRenderer.RenderMacro(Int32 contentId, String alias, IDictionary`2 parameters) in d:\a\1\s\src\Umbraco.Web\UmbracoComponentRenderer.cs:102
   ASP._Page_Views_MacroPartials_EventsSearch_cshtml.Execute() in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\MacroPartials\EventsSearch.cshtml:83
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in d:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult) in d:\a\1\s\src\Umbraco.Web\Mvc\ControllerExtensions.cs:80
   Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content) in d:\a\1\s\src\Umbraco.Web\Macros\PartialViewMacroEngine.cs:98
   Umbraco.Web.Macros.<>c__DisplayClass17_0.<ExecuteMacroOfType>b__0() in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:335
   Umbraco.Web.Macros.MacroRenderer.ExecuteProfileMacroWithErrorWrapper(MacroModel macro, String msgIn, Func`1 getMacroContent, Func`1 msgErr) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:306
   Umbraco.Web.Macros.MacroRenderer.ExecuteMacroWithErrorWrapper(MacroModel macro, String msgIn, String msgOut, Func`1 getMacroContent, Func`1 msgErr) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:265
   Umbraco.Web.Macros.MacroRenderer.ExecuteMacroOfType(MacroModel model, IPublishedContent content) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:332
   Umbraco.Web.Macros.MacroRenderer.Render(MacroModel macro, IPublishedContent content, IDictionary pageElements) in d:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:238
   Umbraco.Web.PropertyEditors.ValueConverters.<>c__DisplayClass7_0.<RenderRteMacros>b__1(String macroAlias, Dictionary`2 macroAttributes) in d:\a\1\s\src\Umbraco.Web\PropertyEditors\ValueConverters\RteMacroRenderingValueConverter.cs:64
   Umbraco.Web.Macros.MacroTagParser.ParseMacros(String text, Action`1 textFoundCallback, Action`2 macroFoundCallback) in d:\a\1\s\src\Umbraco.Web\Macros\MacroTagParser.cs:196
   Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.RenderRteMacros(String source, Boolean preview) in d:\a\1\s\src\Umbraco.Web\PropertyEditors\ValueConverters\RteMacroRenderingValueConverter.cs:70
   Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.Convert(Object source, Boolean preview) in d:\a\1\s\src\Umbraco.Web\PropertyEditors\ValueConverters\RteMacroRenderingValueConverter.cs:96
   Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview) in d:\a\1\s\src\Umbraco.Web\PropertyEditors\ValueConverters\RteMacroRenderingValueConverter.cs:78
   Umbraco.Core.Models.PublishedContent.PublishedPropertyType.ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview) in d:\a\1\s\src\Umbraco.Core\Models\PublishedContent\PublishedPropertyType.cs:219
   Umbraco.Web.PublishedCache.NuCache.Property.GetValue(String culture, String segment) in d:\a\1\s\src\Umbraco.Web\PublishedCache\NuCache\Property.cs:211
   Umbraco.Web.PublishedPropertyExtension.Value(IPublishedProperty property, String culture, String segment, Fallback fallback, T defaultValue) in d:\a\1\s\src\Umbraco.Web\PublishedPropertyExtension.cs:39
   Umbraco.Web.PublishedContentExtensions.Value(IPublishedContent content, String alias, String culture, String segment, Fallback fallback, T defaultValue) in d:\a\1\s\src\Umbraco.Web\PublishedContentExtensions.cs:163
   Umbraco.Web.PublishedModels.Usn_Pc_Text_AN.get_Text() +56
   ASP._Page_Views_Partials_usn_banquet_USNPageComponents_USN_PC_Text_cshtml.Execute() in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\Partials\usn_banquet\USNPageComponents\USN_PC_Text.cshtml:37
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in d:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +136
   ASP._Page_Views_Partials_usn_banquet_USNPageComponents_USN_ComponentSwitch_cshtml.Execute() in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\Partials\usn_banquet\USNPageComponents\USN_ComponentSwitch.cshtml:61
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in d:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +136
   ASP._Page_Views_Partials_usn_banquet_USNPageComponents_USN_PageComponents_cshtml.Execute() in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\Partials\usn_banquet\USNPageComponents\USN_PageComponents.cshtml:15
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in d:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +136
   ASP._Page_Views_USNPage_cshtml.Execute() in C:\Inetpub\vhosts\saugatuck.com\httpdocs\Views\USNPage.cshtml:21
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in d:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +26
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +40
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +648
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4087.0