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:
<aspataList 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>
</aspataList>
<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.
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:
<aspataList 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>
</aspataList>
<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.