I would like to display a tag cloud in my test application using a helper class to create the html.
I can use a for each loop in the partial view to visit each item in the model
Inherits="System.Web.Mvc.ViewUserControl < IEnumerable < MyTestproject.Models.TagCount > >
foreach (var item in Model) {
}
But when I try to pass the model to the Helper class and use a for each loop I receive the following error:
public static string DisplayCloud < TagCount >(TagCount objTags) {
..
foreach (var item in objTags) {
}
}
foreach statement cannot operate on variables of type 'TagCount' because 'TagCount' does not contain a public definition for 'GetEnumerator'
What is the difference or am I passing it incorrectly?