我正在使用telerik灯箱控件来显示图像,是否可以循环浏览文件夹中的所有图像,并将它们显示在灯箱控件中?在codebehind或ascx
中以下是我的灯箱的代码
<asp:Image ID="Image2" AlternateText="Mountain Pine Cones Thumbnail" runat="server" CssClass="gray" ImageUrl="~/images/JobImages/t1.jpg" />
<telerik:RadLightBox RenderMode="Lightweight" ID="RadLightBox2" runat="server" Modal="true" LoopItems="true" ZIndex="100000">
<Items>
<telerik:RadLightBoxItem ImageUrl="../images/lightbox1.jpg" Height="550" Width="550" Title="" TargetControlID="Image1" Description="<div style='width:950px;'> <div class='btn btn-info' id='btn1' style='float:left;'>Task </div> <div id='demo' style='color: black;width:800px;float:right;display:none;'>1 </div> <div id='demo2' style='color: black;width:800px;float:right;display:none;'>2 </div> <div id='demo3' style='color: black;width:800px;float:right;display:none;'>3 </div> <br /> <br /><div class='btn btn-info' id='btn2' data-toggle='collapse' style='float:left;'>Task Description</div><br /> <br /><div class='btn btn-info' id='btn3' data-toggle='collapse' style='float:left;'>Project Managers</div></div>">
</telerik:RadLightBoxItem>
<telerik:RadLightBoxItem ImageUrl="../images/lightbox2.jpg" Height="550" Width="550" Title="" TargetControlID="Image1" Description="<div style='width:950px;'> <div class='btn btn-info' id='btn1' style='float:left;'>Task </div> <div id='demo' style='color: black;width:800px;float:right;display:none;'>1 </div> <div id='demo2' style='color: black;width:800px;float:right;display:none;'>2 </div> <div id='demo3' style='color: black;width:800px;float:right;display:none;'>3 </div> <br /> <br /><div class='btn btn-info' id='btn2' data-toggle='collapse' style='float:left;'>Task Description</div><br /> <br /><div class='btn btn-info' id='btn3' data-toggle='collapse' style='float:left;'>Project Managers</div></div>">
</telerik:RadLightBoxItem>
<telerik:RadLightBoxItem ImageUrl="../images/lightbox3.jpg" Height="550" Width="550" Title="" TargetControlID="Image1" Description="<div style='width:950px;'> <div class='btn btn-info' id='btn1' style='float:left;'>Task </div> <div id='demo' style='color: black;width:800px;float:right;display:none;'>1 </div> <div id='demo2' style='color: black;width:800px;float:right;display:none;'>2 </div> <div id='demo3' style='color: black;width:800px;float:right;display:none;'>3 </div> <br /> <br /><div class='btn btn-info' id='btn2' data-toggle='collapse' style='float:left;'>Task Description</div><br /> <br /><div class='btn btn-info' id='btn3' data-toggle='collapse' style='float:left;'>Project Managers</div></div>">
</telerik:RadLightBoxItem>
<telerik:RadLightBoxItem ImageUrl="../images/lightbox4.jpg" Height="550" Width="550" Title="" TargetControlID="Image1" Description="<div style='width:950px;'> <div class='btn btn-info' id='btn1' style='float:left;'>Task </div> <div id='demo' style='color: black;width:800px;float:right;display:none;'>1 </div> <div id='demo2' style='color: black;width:800px;float:right;display:none;'>2 </div> <div id='demo3' style='color: black;width:800px;float:right;display:none;'>3 </div> <br /> <br /><div class='btn btn-info' id='btn2' data-toggle='collapse' style='float:left;'>Task Description</div><br /> <br /><div class='btn btn-info' id='btn3' data-toggle='collapse' style='float:left;'>Project Managers</div></div>">
</telerik:RadLightBoxItem>
</Items>
</telerik:RadLightBox>
但是,不是硬编码路径,而是在代码隐藏中设置它以循环遍历所有以“lightbox”开头并显示它们的图像?