Hello everybody! Well, in my case, I had two divs inside another one, I had been trying to hide them, so, I used this code and works perfectly:
protected void Page_Load(object sender, EventArgs e)
{
var HideDiv= this.Master.FindControl("MainDiv");
if (HideDiv != null)
{
HtmlGenericControl InsideDiv_1 = (HtmlGenericControl)HideDiv.FindControl("InsideDiv1");
HtmlGenericControl InsideDiv_2 = (HtmlGenericControl)HideDiv.FindControl("InsideDiv2");
if (InsideDiv_1 != null)
{
InsideDiv_2.Visible = false;
InsideDiv_1.Visible = false;
}
}
}
}
Good Luck.