我搜索了很多问题,阅读了很多解决方案,但仍然没有找到解决我正在努力解决的问题的解决方案:我的列表视图显示了目录中的一些图片,但有时我忘记旋转图片,那里我想要一个按钮来选择一个项目,然后是一个按钮来旋转显示的图片。但我无法解析保存 URL 值的 2 个隐藏字段中的值。我得到起始值而不是评估值:
Dim URLorg As HiddenField = TryCast(FotoListView.Items(FotoListView.SelectedIndex).FindControl("URLorigineel"), HiddenField)
URLorg.value 给出 >> "../<%# Eval("URLoriginel") %>"
来源:
<asp:ListView runat="server" ID="FotoListView" ItemPlaceholderID="PlaceHolder3" DataSourceId='odsAvailableFotos' DataKeyNames="ID">
<LayoutTemplate>
<ul>
<div style="overflow:scroll; height:380px;"> <asp:PlaceHolder runat="server" ID="PlaceHolder3" />
</div>
</ul>
</LayoutTemplate>
<ItemTemplate>
<li>
<hr />
<asp:LinkButton runat="server" ID="LinkButton1" Text="Select" CommandName="Select" BackColor="#33CCFF" BorderColor="#003399" Width="70" CssClass="PhotoEditBtn" Height="15" />
<a href='../<%# Eval("URLorigineel") %>' target="_blank" id="ImageRef"><%# Eval("Caption")%><br />
<img src='../<%# Eval("URL") %>' alt="Click to see image" class="Rounded_image_sample" id="ImgSource" />
</a>
<asp:HiddenField ID="URL" runat="server" Value='../<%# Eval("URL") %>' />
<asp:HiddenField ID="URLorigineel" runat="server" Value='../<%# Eval("URLorigineel") %>' />
</li>
</ItemTemplate>
<SelectedItemTemplate>
<li>
<hr />
<asp:LinkButton runat="server" ID="LinkButton1" Text="Delete" CommandName="Delete" BackColor="#33CCFF" BorderColor="#003399" Width="70" CssClass="PhotoEditBtn" Height="15" />
<asp:Label ID="dummy1" runat="server" text=" " />
<asp:LinkButton runat="server" ID="LinkButton2" Text="Rotate" CommandName="Rotate" CssClass="PhotoEditBtn" BackColor="#33CC33" Width="70" Height="15" />
<asp:LinkButton runat="server" ID="LinkButton3" Text="Cancel" CommandName="ANnuleer" CssClass="PhotoEditBtn" BackColor="#33CC33" Width="70" Height="15" />
<br />
<a href='../<%# Eval("URLorigineel") %>' target="_blank" id="ImageRef"><%# Eval("Caption")%><br />
<img src='../<%# Eval("URL") %>' alt="Click to see image" class="Rounded_image_sample" id="ImgSource" />
</a>
<asp:HiddenField ID="URL" runat="server" Value='../<%# Eval("URL") %>' />
<asp:HiddenField ID="URLorigineel" runat="server" Value='../<%# Eval("URLorigineel") %>' />
</li>
</SelectedItemTemplate>
</asp:ListView>