I typically hide and show controls by setting a css property on a div that surrounds the control I want to hide/show. For example:
<
div id="dvButton" runat="server" class="HideControl">
<asp:Button ID="btn" runat="server" Text="Button Text" />
</
div>
This button is hidden by default, but on postback, I change the class property of the div to show the control:
dvButton.Attributes[
"class"] = "ShowControl";
The css code looks like this:
.HideControl
{
display
:none;
}
.ShowControl
{
display:inline;
}
I'm using this in a user control, and am using the AjaxManager to ajaxify all postbacks. The problem I'm having is that the css class isn't getting updated (i.e. the control doesn't show up after postback). I would think this would be a pretty common issue. Any suggestions?