I’m trying to build a sort of Accordion effect using a GridView and UpdatePanels. And I have problems with tieing everything together:
<asp:GridView ID="gridMain"
runat="server"
...
>
<Columns>
...
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<span>Id:<%# Eval("Id") %></span>
<a href="/* javascript code to open the updatepanel??*/" title="Open"><img ..../></a>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:PlaceHolder runat="server" Visible="false">
<asp:Label Text="??"/>
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
How do I open the update panel using javascript?
If you really want to go with the UpdatePanel approach, here’s how to make it work:
Now I would also say this is probably not the best idea… but hammers, nails, etc…