Add the runat=”server” to this html control and then set the visible property in the code behind.show example
protected void Button1_Click(object sender, EventArgs e)
{
//Condition
if (true)
{
//Hide the img control
Page.RegisterStartupScript("imgDisplay", "<script> document.getElementById('imgClient').style.visibility='hidden'; </script> ");
}
else
{
//Display the img control
Page.RegisterStartupScript("imgDisplay", "<script> document.getElementById('imgClient').style.visibility='display'; </script>");
}
}
or you can use client script to hide or display this html control. To do this, register the script in the code behind base on the condition.