0

I'm developing an applications, it involves a dropdownlist with image and text in MVC4. For instance, displaying image (Country Flag) with name of the country. I've used AutoMapper, IEnumerable. It says error as AutoMapperMappingExtensions was unhandled by user.

Description as

Missing type map configuration or unsupported mapping.

Mapping types:
Country -> ImageSelectListItem
MvcWebRole.Models.Country -> System.Web.Mvc.Html.ImageSelectListItem

Destination path:
IEnumerable`1[0]

Source value:
MvcWebRole.Models.Country

The occurance of error in Controller as

Mapper.Map<IEnumerable<Country>, IEnumerable<ImageSelectListItem>>(countryList)

index.cshtml

@Html.DropDownListFor 

In cshtml error description as

The type arguments for method
'System.Web.Mvc.html.ImageselectExtensions.dropdownlistfo<TModel,TProperty> (
    System.Web.mvc.htmlhelper<TModel>,
    System.Linq.Expression<System.Func<TModel,TProperty>>,
    string,
    System.Collections.Generic.IEnumerable<System.Web.Mvc.Html.ImageSelectListItem>,
    Object)'
cannot be inferred from the usage. Try Specifying the type arguments explicitly.
Mightymuke
  • 5,094
  • 2
  • 31
  • 42
Infanty Rajan
  • 21
  • 1
  • 3
  • That error says you're missing some mapping configuration. If possible, please show the mapping you have currently defined. Thx – Mightymuke Apr 14 '13 at 22:39
  • You're going to have to provide more information. You need to provide the Mapping configuration and the definition of Country. – Erik Funkenbusch Apr 15 '13 at 00:01

0 Answers0