[Solved] ASP.net Null Reference Exception Due to Not Finding Controls

In my experience, DIV’s are not registered to the server like ASP controls are so calling them directly would produce bad results. When making changes to the controls, i.e. adding styles, make sure you tell ASP what kind of control you have. For example: HtmlGenericControl _fail = (HtmlGenericControl)Page.FindControl(“fail”); _fail.Style.Item(“visibility”) = “hidden”; Edit: The problem lies … Read more