views:

158

answers:

0

I have a popup extender linked to a panel as illustrated by the markup below:

<asp:Button runat="server" ID="buttonViewQuestionPopupController" style="display:none"  />  
<ajaxToolkit:ModalPopupExtender 
    runat="server" 
    ID="popupViewQuestion" 
    PopupControlID="panelViewQuestion" 
    TargetControlID="buttonViewQuestionPopupController"
    DropShadow="True"
    BackgroundCssClass="modalBackground"
    >
</ajaxToolkit:ModalPopupExtender>        
<asp:Panel runat="server" ID="panelViewQuestion" Style="display: none" CssClass="modalPopupViewQuestion">
    <asp:UpdatePanel runat="server" ID="updatePanelViewQuestion">
        <ContentTemplate>
            <asp:Label runat="server" ID="labelTestInsidePanel" Text="Testing changes made in code......"/>
            <ContactorCompliance:QuestionDialog runat="server" id="dialogViewQuestion"></ContactorCompliance:QuestionDialog>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>

After a postback (in this case a question is selected in a grid), I want to be able to change the css class of panelViewQuestion.

However, any programmatic changes I make to panelViewQuestion seem to be ignored.

Changes to labelTestInsidePanel and dialogViewQuestion take effect.

I looked at the rendered output and it contains two divs (an outer and an inner) with the original css class from the markup set on the inner div.

Does anyone know a) why the programmatic change to panelViewQuestion don't take effect and b) how I might be able to make them?

If I can't work this out, I will have to have multiple panel and extender sets in the page, each with a different css class set on the panel. I really don't want to have to do that......

UPDATE

Does no-one know the whys of this? Has no-one else had to modify the properties of a panel linked to a popup?