Hi Guys,
I am getting an error in dropdown list.
Overload resolution failed because no Public 'BindTo' is most specific for these arguments:
'Public Function BindTo(dataSource As System.Collections.Generic.IEnumerable(Of SelectListItem)) As Kendo.Mvc.UI.Fluent.DropDownListBuilder':
Not most specific.
'Public Function BindTo(dataSource As System.Collections.Generic.IEnumerable(Of DropDownListItem)) As Kendo.Mvc.UI.Fluent.DropDownListBuilder':
Not most specific.
This is the line where this exception is being thrown at:
<div class="editor-field">
@(Html.Kendo().DropDownList().Name("ExternalMailItemID").BindTo(ViewData("ExternalMailItem")))
@Html.ValidationMessageFor(Function(model) model.ExternalMailItemID)
</div>
This is what i am doing in the controller:
<HttpPost()> _
Function Create(ByVal collection As ExternalMailCost) As ActionResult
Try
If _repositoryForMailItem.IsExternalMailItemExist(collection.ExternalMailItemID, collection.StartDate, collection.EndDate) = True Then
ModelState.AddModelError("", "Unable to add record. There is an overlapping record for this mail item")
End If
If ModelState.IsValid Then
'Check whether a cost has already been associated with the same mail item
' if there is already cost associated, then check whether the dates selected overlapse?
_repositoryForMailCost.Save(collection, "VivekBa")
End If
Return View()
Catch
Return View()
End Try
End Function
The error is thrown when i add the error in the addmodelerror, otherwise it works fine. please help
I am getting an error in dropdown list.
Overload resolution failed because no Public 'BindTo' is most specific for these arguments:
'Public Function BindTo(dataSource As System.Collections.Generic.IEnumerable(Of SelectListItem)) As Kendo.Mvc.UI.Fluent.DropDownListBuilder':
Not most specific.
'Public Function BindTo(dataSource As System.Collections.Generic.IEnumerable(Of DropDownListItem)) As Kendo.Mvc.UI.Fluent.DropDownListBuilder':
Not most specific.
This is the line where this exception is being thrown at:
<div class="editor-field">
@(Html.Kendo().DropDownList().Name("ExternalMailItemID").BindTo(ViewData("ExternalMailItem")))
@Html.ValidationMessageFor(Function(model) model.ExternalMailItemID)
</div>
This is what i am doing in the controller:
<HttpPost()> _
Function Create(ByVal collection As ExternalMailCost) As ActionResult
Try
If _repositoryForMailItem.IsExternalMailItemExist(collection.ExternalMailItemID, collection.StartDate, collection.EndDate) = True Then
ModelState.AddModelError("", "Unable to add record. There is an overlapping record for this mail item")
End If
If ModelState.IsValid Then
'Check whether a cost has already been associated with the same mail item
' if there is already cost associated, then check whether the dates selected overlapse?
_repositoryForMailCost.Save(collection, "VivekBa")
End If
Return View()
Catch
Return View()
End Try
End Function
The error is thrown when i add the error in the addmodelerror, otherwise it works fine. please help