Monday, March 26, 2012

UpdatePanel + Invisible control = Problems

Hi Guys,

I created my own UserControl that only contains the following. (The code for a basic DropDownExtender) The control is called ProgEdit

1<cc1:DropDownExtender ID="dde" runat="server" TargetControlID="lblAssigned" DropDownControlID="DropPanel"></cc1:DropDownExtender>
2<asp:Label ID="lblAssigned" runat="server" Text="Label" Style="display: block; width: 300px; padding:2px; padding-right: 50px; font-family: Tahoma; font-size: 11px;" ></asp:Label>
3<asp:Panel id="DropPanel" runat="server" Style="display :none; visibility: hidden;background: url(http://localhost/project/images/ajax-menu-bg.gif) repeat-y 0 0 #FAFAFA; z-index: 1000;">
4 <asp:LinkButton runat="server" ID="lnkName" />
5</asp:Panel>

I've got a seperate page that contains an update panel. The update panel contains a ProgEdit control which is inially invisible.

1<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
2<ContentTemplate>
3 <ds:ProgEdit runat="server" id="progEdit" visible="false" />
4 <asp:Button runat=server ID="btntest" OnClick="VisibleEdit"/>
5</ContentTemplate>
6</asp:UpdatePanel>

The problem: When I click the btnTest the ProgEdit control is set to visible. But the DropDownExtender control doesn't work correctly. (The dropdown image on the side is missing)
Whats wrong?

If I remove the UpdatePanel, the DropDownExtender runs fine.
If I add another ProgEdit anywhere on the page (which isnt set to Visible=false) it runs fine.

Any ideas?

Any ideas?

No comments:

Post a Comment