When we design the Page in ASP.NET Is it possible to remove the unused controls from codebehind instead of hiding them? Because, hiding them from codebehind makes them invisible but do not remove completely resulting in whitespaces on user screens.
for eg:-
<td>
<uc1:GoToRequestControl id="UserControl" runat="server" />
we try to show/hide form Codebehind as follows
if (Condition)
{
UserControl.Visible = false;
}
This hides the control but the space for this control stays on the Page. Is there a way we can remove the whitespacing for these hidden controls and make the page look better? We are using tables to define the layout, Is this the reason for the above behavior?