UpdatePanel only updates once

S

Scott M

I have a listview that contains thumbnails of images. When one is
clicked it should show the full size image below in an asp:image
control. The first time a thumbnail is clicked it works. The second
time it will not. I tried updating the UpdatePanel manually had got the
same results.

here is the datalist and updatepanel from my .aspx:

<asp:DataList BackColor="Black" ID="DataList1"
runat="server" CellPadding="10" RepeatColumns="3"
RepeatDirection="Vertical">
<ItemTemplate>
<asp:ImageButton ID="meterImage" runat="server"
OnCommand="meterImage_ClickCommand"
commandargument='<%#
DataBinder.Eval(Container.DataItem,"picture") %>'
imageurl='<%#
DataBinder.Eval(Container.DataItem,"picture") %>' />
</ItemTemplate>
</asp:DataList>

<asp:UpdatePanel ID="meterUpdatePanel" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<div id="meterpicDIV" style="margin-top: 5px;">
<asp:Image ID="imgBigMeter" runat="server"
ImageUrl="" />
</div>
</ContentTemplate>
</asp:UpdatePanel>


and here is the method in my code behind that changes the image:

protected void meterImage_ClickCommand(object sender,
CommandEventArgs e)
{
string thumburl = e.CommandArgument as string;
string meterurl = "images/meters/" + Path.GetFileName(thumburl);
imgBigMeter.ImageUrl = meterurl;
meterUpdatePanel.Update();
}

Any thoughts? Its been frustrating me all day.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top