Click here to Skip to main content
15,669,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey Guys,
I have got two datalists the fist one shows the list of my galleries and the second one shows the images of that gallery. since this is a one page design i want to load images for each gallery by clicking a botton (available for each item in the gallery datalist)

I ve been reading about triggers and AsyncPostBackTriggerbut haven't been abale to make it work !:(((

I want to load the images for each gallery by clicking the ShowItems button for that item in the gallery datalist.

The fist one

    <asp:Panel runat="server" ID="PanelShowGallery">
        <asp:DataList ID="DataListImageGallery" runat="server" OnItemDataBound="DataListImageGallery_ItemDataBound" RepeatColumns="4" OnItemCommand="DataListImageGallery_ItemCommand">
                <div id="GalleryList" style="text-align: center; padding: 5px;">
                    <asp:HiddenField ID="HiddenFieldValue" Value='<%# Eval("gId") %>' Visible="false" runat="server" />
                    <asp:Image ID="ImageGallery" runat="server" ToolTip='<%# Eval("gTitle") %>' Style="border: 2px solid silver; padding: 5px; background-color: #1c28b5;" />
                    <div style="color: Black; padding: 0px; margin-removed 0px; border: 2px solid silver; background-color: #f0f0f0; width: 100px; margin: 0 auto; min-height: 22px; height: auto; border-top-style: none; font-size: x-small; font-family: Tahoma;">
                        <%# Eval("gTitle") %>
                    <asp:Button runat="server" ID="ShowItems" CommandArgument='<%# Eval("gId") %>' CommandName="ShowItems" Text="ShowImages" />

The Second one

<asp:DataList runat="server" ID="DataListImages" CellPadding="10" RepeatDirection="Horizontal">
                            <div class="Images">
                                <a href='<%# Eval("LPicture.Virtual_FileName") %>' title='<%# Eval("giTitle") %>'>
                                    <asp:Image ImageUrl='<%# Bind("SPicture.Virtual_FileName")%>' runat="server" BorderStyle="None"
                                        ID="ImageThumb" ToolTip='<%# Eval("giDescription") %>' />

I'd appreciate any help
Thank you
Sinisa Hajnal 5-Sep-14 1:22am    
Asyncpostback is a property of UpdatePanel, not Panel.

1 solution

Load the initial gallery normally on click. Then, upon user clicking one particular gallery, get image for that gallery. You need to put gallery-id (or however you differentiate the galleries) into button CommandArgument.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900