string menus= ",M_Hosp,M_Ho_1,"; M_Home.Visible = menus.Contains("," + M_Home.ID + ",") ? true : false;
foreach (System.Web.UI.HtmlControls.HtmlGenericControl labels in this.Page.Form.Controls.OfType<System.Web.UI.HtmlControls.HtmlGenericControl>()) { if (labels.ID.StartsWith("li_")) { if (menus.Contains("," + labels.ID.Replace("li_", "") + ",")) { labels.Visible = true; } else { labels.Visible = false; } } foreach (System.Web.UI.HtmlControls.HtmlAnchor anchor in labels.Page.Form.Controls.OfType<System.Web.UI.HtmlControls.HtmlAnchor>()) { if (menus.Contains("," + anchor.ID + ",")) { anchor.Visible = true; } else { anchor.Visible = false; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)