JSSOR with ASP.NET dynamic image

2019-09-06 02:30发布

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条回答
对你真心纯属浪费
2楼-- · 2019-09-06 03:18

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>
查看更多
登录 后发表回答