This is a migrated thread and some comments may be shown as answers.

Hide/Show Controls with CSS Not Working

1 Answer 60 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Paul Bishop
Top achievements
Rank 1
Paul Bishop asked on 05 Sep 2008, 12:17 PM
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?

1 Answer, 1 is accepted

Sort by
0
Paul Bishop
Top achievements
Rank 1
answered on 05 Sep 2008, 07:15 PM
Ok, I figured this one out.  I didn't have a reference to the div in the RadAjaxManagerProxy as an updated control.
Tags
Ajax
Asked by
Paul Bishop
Top achievements
Rank 1
Answers by
Paul Bishop
Top achievements
Rank 1
Share this question
or