Consider have this line of code:
List<HtmlGenericControl> listOfDivs =
this.clientGrid.Controls.OfType<HtmlGenericControl>()
.ToList<HtmlGenericControl>();
The OfType<>(); isn’t recognised, assuming due to a missing using directive. I’ve tried using System.Web.UI.ControlCollection;, but that didn’t solve the problem.
How can this be fixed?
To use
OfType<T>, you need ausing System.Linq;directive in your code file. This also requires a reference toSystem.Core.dll(referenced in most typical if not all default applications created in Visual Studio 2008+).