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
<aspanel ID="PanelImages" runat="server" ScrollBars="Vertical"
Height="650" Width="520" BackColor="#CCCCCC">
<aspataList 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" />
</aspataList>
</aspanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="PicturesInFolder"
EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<aspanel 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>
</aspanel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:TextBox ID="txtImgURL" runat="server" Width="900px"></asp:TextBox>
<asp:TextBox ID="txtImagePath" runat="server"
Width="900px"></asp:TextBox>
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
<aspanel ID="PanelImages" runat="server" ScrollBars="Vertical"
Height="650" Width="520" BackColor="#CCCCCC">
<aspataList 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" />
</aspataList>
</aspanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="PicturesInFolder"
EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<aspanel 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>
</aspanel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:TextBox ID="txtImgURL" runat="server" Width="900px"></asp:TextBox>
<asp:TextBox ID="txtImagePath" runat="server"
Width="900px"></asp:TextBox>