Posted on: 8/14/2014 4:04:04 PM | Views : 383

So I have a content page that is linked to our master page.
when certain users login, we are setting hyperlink colors and hiding certain links.. so I was hoping to loop thru all controls on the page and make those changes.
I have been looking for about 3hrs now, trying all examples found and the code below never hits the if condition for "hyperlink"
foreach (Control masterControl in Page.Controls) { if (masterControl is MasterPage) { foreach (Control formControl in masterControl.Controls) { if (formControl is System.Web.UI.HtmlControls.HtmlForm) { foreach (Control contentControl in formControl.Controls) { if (contentControl is ContentPlaceHolde ...

Go to the complete details ...