Hi,
I have a datepicker on my cshtml view. I'm creating it with the following line (which I'm using elsewhere successfully):
@Html.Kendo().DateTimePicker().HtmlAttributes(new { @id = "fltBeginDate" }).Value(DateTime.Now).Format("MM/dd/yyyy")
When the view tries to load, I get the following error:
Value cannot be null.
Parameter name: key
StackTrace:
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at System.Web.Mvc.ModelStateDictionary.TryGetValue(String key, ModelState& value)
at Kendo.Mvc.UI.InputComponentExtensions.GetAttemptedValue[T](IInputComponent`1 instance)
at Kendo.Mvc.UI.Html.DatePickerHtmlBuilderBase.Build()
at Kendo.Mvc.UI.DateTimePicker.WriteHtml(HtmlTextWriter writer)
at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
at System.Web.HttpUtility.HtmlEncode(Object value)
at System.Web.WebPages.WebPageBase.Write(Object value)
at ASP._Page_Views_PlantDeclaration_Index_cshtml.Execute()
Any help is appreciated!
Thanks,
Eddie
I have a datepicker on my cshtml view. I'm creating it with the following line (which I'm using elsewhere successfully):
@Html.Kendo().DateTimePicker().HtmlAttributes(new { @id = "fltBeginDate" }).Value(DateTime.Now).Format("MM/dd/yyyy")
When the view tries to load, I get the following error:
Value cannot be null.
Parameter name: key
StackTrace:
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at System.Web.Mvc.ModelStateDictionary.TryGetValue(String key, ModelState& value)
at Kendo.Mvc.UI.InputComponentExtensions.GetAttemptedValue[T](IInputComponent`1 instance)
at Kendo.Mvc.UI.Html.DatePickerHtmlBuilderBase.Build()
at Kendo.Mvc.UI.DateTimePicker.WriteHtml(HtmlTextWriter writer)
at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
at System.Web.HttpUtility.HtmlEncode(Object value)
at System.Web.WebPages.WebPageBase.Write(Object value)
at ASP._Page_Views_PlantDeclaration_Index_cshtml.Execute()
Any help is appreciated!
Thanks,
Eddie