i created html generic controls as (ul) and (il) at runtime then iwanna to loop inside my page to get all ul and il crated in run time wrote this code to loop inside page controls
foreach (HtmlGenericControl item in Page.Controls)
{
}
i created html generic controls as (ul) and (il) at runtime then iwanna to loop inside my page to get all ul and il crated in run time wrote this code to loop inside page controls
foreach (HtmlGenericControl item in Page.Controls)
{
}
Use the OfType<T>()
extension method to get only HtmlGenericControls.
foreach (HtmlGenericControl item in Page.Controls.OfType<HtmlGenericControl>())
{
}