I am using ASP.NET web forms to design a site. One of the pages uses a <DIV>
to hold a scrolling list of asp:ImageButton
controls, each of which displays an image. The goal is to be able to display a long list of images inside a scrollable DIV tag, making it easier for the user to choose one without using a third-party control and avoiding controls that require paging. Here's a sample of the DIV I've built:
<div id="divOne" runat="server" style="height: 230px; width: 330px; overflow: auto;text-align: center;">
<asp:ImageButton runat="server" ImageUrl="../Images/image1_small.jpg" AlternateText="Image #1" CommandArgument="Image #1" OnClick="ImagePicked" /><br />
<asp:ImageButton runat="server" ImageUrl="../Images/image2_small.jpg" AlternateText="Image #2" CommandArgument="Image #2" OnClick="ImagePicked" /><br />
...
</div>
When the user clicks an image, it triggers an action to update another part of the page. But the problem is that when the image is clicked and the action fires, the list of images resets back to the first one at the top of the list.
I tried using an UpdatePanel
to control this, but it still happens. Is there any way to prevent the list of images from resetting?