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

Last Reply 6 days ago By dharmendr

Posted 6 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

 

You are viewing reply posted by: dharmendr 6 days ago.
Posted 6 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>();