ASP.Net MVC Error: Cannot implicitly convert type List<Category> to string

Last Reply 17 days ago By dharmendr

Posted 17 days ago

hello,

i have a view model and a partial view which i need to use again and again 

i want to pass conditional data to my partial view so one partial view can be used every where just pass conditional data but when i try to pass conditional data it gives error

 

Posted 17 days ago

As per your error you have declared productCategories as string and assigned Generic List to the properties.

var productCategories = "";

Change above line with the below.

var productCategories = new List<MVC_ViewModel.Models.Category>();