UpdatePanel for image

D

David C

I have an aspx page that has a 3 column DataList of images on the left side
of the page and a larger image control on the right side. I have the larger
image in a UpdatePanel with a trigger pointing to the SelectedIndexChanged
property of the DataList. The DataList photo caption is a LinkButton that
fires the "Select" command but when I click it, the large photo does not
refresh. Below is the SelectedIndexChanged code and the page section below
that. The process in SelectedIndexChanged is the same process I use at
Page_Load to fill the large photo with the first photo found. Can anyone
spot why this is not working? Thanks.
-David



Protected Sub PicturesInFolder_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
PicturesInFolder.SelectedIndexChanged
ResizedImageLarge.Parameters(0).Value = txtImgURL.Text
End Sub


<asp:panel ID="PanelImages" runat="server" ScrollBars="Vertical"
Height="650" Width="520" BackColor="#CCCCCC">
<asp:DataList ID="PicturesInFolder" runat="server" CellPadding="3"
Visible="True" BorderColor="Black"
ItemStyle-BorderWidth="1pt" ItemStyle-BorderColor="Black"
ItemStyle-BorderStyle="Solid" Width="460"
RepeatDirection="Horizontal"
RepeatLayout="Table" RepeatColumns="3">
<ItemTemplate>
<table>
<tr>
<td><cc1:GeneratedImage
ID="ResizedImageGenerator" runat="server"
ImageHandlerUrl="~/ImageHandlers/ResizeImageHandler.ashx"
AlternateText="Click to enlarge">
<Parameters>
<cc1:ImageParameter Name="ImageUrl"
Value='<%# Container.DataItem %>' />
<cc1:ImageParameter Name="Width"
Value="120" />
</Parameters>
</cc1:GeneratedImage>
</td>
</tr>
<tr>
<td align="center">
<asp:LinkButton ID="LBtnPickPhoto"
runat="server"
Text='<%#
System.IO.Path.GetFilename(Container.DataItem) %>'
CommandName="Select"
Font-Size="Smaller" CssClass="Show"
OnClientClick="return
largeimage(this);"></asp:LinkButton>
</td>
</tr>
</table>
</ItemTemplate>
<AlternatingItemStyle BackColor="Transparent" />
<ItemStyle BorderColor="Black" BorderStyle="Solid"
BorderWidth="1pt" />
</asp:DataList>
</asp:panel>

<asp:UpdatePanel ID="UpdatePanel1" runat="server"
UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="PicturesInFolder"
EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:panel ID="PanelPhoto" runat="server" CssClass="LargePhoto"
BorderStyle="Solid" BorderWidth="1px">
<cc1:GeneratedImage ID="ResizedImageLarge" runat="server"
ImageHandlerUrl="~/ImageHandlers/ResizeImageHandler.ashx"
CssClass="Show">
<Parameters>
<cc1:ImageParameter Name="ImageUrl" Value='' />
<cc1:ImageParameter Name="Width" Value="700" />
</Parameters>
</cc1:GeneratedImage>
</asp:panel>
</ContentTemplate>

</asp:UpdatePanel>

<asp:TextBox ID="txtImgURL" runat="server" Width="900px"></asp:TextBox>
<asp:TextBox ID="txtImagePath" runat="server"
Width="900px"></asp:TextBox>
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top