Invalid cast exception C# ASP.Net

davabe

New Member
\[code\]foreach(Label l in Controls) // setting all labels' s visbility on page to true l.Visible =true;\[/code\]But on running ,i am getting following error\[code\]Unable to cast object of type 'ASP.admin_master' to type 'System.Web.UI.WebControls.Label'.\[/code\]
 
Back
Top