JSSOR with ASP.NET dynamic image

喜夏-厌秋 提交于 2020-01-25 23:48:10

问题


Here is my HTML Code that i am using

<div u="slides">
      <div>
      <asp:SqlDataSource ID="1" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT Image FROM Gallery"></asp:SqlDataSource>
           <asp:Repeater ID="Repeater1" runat="server" DataSourceID="1">
               <ItemTemplate>
                   <img u="image" src="<%# "image.ashx?Id="+ Eval("Id") %>" />
               </ItemTemplate>
        </asp:Repeater>
        </div>

The Generic Handler .ashx for the image is THIS
My Issue is that on the Slide, only the last image uploaded come out. For example, if i uploaded 5 images, only the fifth last uploaded image come up on the slider and it remains static.

I have tested the same generic Handler. it works normal for another slider. am i missing something.

P.S - the Jssor scripts and css are all in their default values. nothing was edited.


回答1:


You placed all images in a single slide. Please create slide for every image as below.

<div u="slides">
    <asp:SqlDataSource ID="1" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT Image FROM Gallery"></asp:SqlDataSource>
           <asp:Repeater ID="Repeater1" runat="server" DataSourceID="1">
               <ItemTemplate>
                   <div>
                       <img u="image" src="<%# "image.ashx?Id="+ Eval("Id") %>" />
                   </div>
               </ItemTemplate>
           </asp:Repeater>
    </asp:SqlDataSource>
</div>


来源:https://stackoverflow.com/questions/29744072/jssor-with-asp-net-dynamic-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!