在listview CSS中需要帮助来绑定图像。 [英] Need help in listview CSS to bind images.

查看:102
本文介绍了在listview CSS中需要帮助来绑定图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生。我建立了一个网站。其中想要显示我的客户列表与客户端的照片。我正在使用listview动态绑定图像。它显示页面加载时的所有照片。但我需要显示一张照片,然后滑到下一张照片。喜欢幻灯片。任何人都有解决方案。



我的代码是: -



 <   asp:ListView     ID   =  lvAlbums    runat   =  server    GroupItemCount   =  2       >  
< LayoutTemplate >
< id = itemPlaceholderContainer >
< ; tr runat < span class =code-keyword> = server id = itemPlaceholder >
< / tr >
< / table >
< / LayoutTemplate >
< LayoutTemplate >
< 表格 >
< tr id = groupPlaceholder runat = server >
< / tr >
< / table >
< / LayoutTemplate >
< GroupTemplate >
< tr >
< span class =code-keyword>< td id = itemPlaceholder runat = server >
< / td >
< / tr >
< / GroupTemplate >
< ItemTemplate >
< td align = center >
< div >
< img alt = Photo1 id = Image1 < span class =code-attribute> style = 高度:100像素; width:150px runat = server src =' <% #Bind( FileName 〜/ Images / Clients / {0}%> ' / >
< / span >
< ; / div >


<小号pan class =code-keyword>< / td >
< / ItemTemplate >
< GroupSeparatorTemplate >
< tr < span class =code-attribute> id = Tr1 runat = 服务器 >
< td >

< / td >
< / tr >
< / GroupSeparatorTemplate >
< / asp:ListView >









受保护的子页面_Load(ByVal发送者为对象,ByVal e As System.EventArgs)处理Me.Load 
如果不是Page.IsPostBack则
fillgrid()
End if
End Sub
Public Sub fillgrid()
Dim arr()As String
Dim dt As New DataTable
dt.Columns.Add( FileName


Dim path As String = Server.MapPath( Images \Clients \)
Dim di As New DirectoryInfo(path)
Dim f As FileInfo
For each f in di.GetFiles
arr = f.Name.Split(

dt.Rows.Add(f.Name)

下一个
lvAlbums.DataSource = dt
lvAlbums.DataBind()



End Sub





我尝试了什么:



i我正在使用选框,但它不能像我需要的那样...... div class =h2_lin>解决方案

请看看这些链接



Bootstrap Carousel Plugin [ ^ ]

Carousel [ ^ ]

如何使用Bootstrap 3创建轮播 [ ^ ]

sir. i build a website. in which want to show my clientlist with photo of the client. i am using listview to bind images dynamically. it show all photos at the time of page load. but i need to show one photo then slide to next photo. like slideshow. anyone have solution of it.

my code is :-

 <asp:ListView ID="lvAlbums" runat="server" GroupItemCount="2"   >
    <LayoutTemplate>
        <table id="itemPlaceholderContainer">
            <tr runat="server" id="itemPlaceholder">
            </tr>
        </table>
    </LayoutTemplate>
    <LayoutTemplate>
        <table>
            <tr id="groupPlaceholder" runat="server">
            </tr>
        </table>
    </LayoutTemplate>
    <GroupTemplate>
        <tr>
            <td id="itemPlaceholder" runat="server">
            </td>
        </tr>
    </GroupTemplate>
    <ItemTemplate>
        <td align="center">
            <div>
           <img alt="Photo1" id="Image1"  style="height:100px; width:150px" runat="server" src='<%# Bind("FileName", "~/Images/Clients/{0}") %>' />
           </span>
            </div>


        </td>
    </ItemTemplate>
    <GroupSeparatorTemplate>
        <tr id="Tr1" runat="server">
            <td>

            </td>
        </tr>
    </GroupSeparatorTemplate>
</asp:ListView>





Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      If Not Page.IsPostBack Then
          fillgrid()
      End If
  End Sub
  Public Sub fillgrid()
      Dim arr() As String
      Dim dt As New DataTable
      dt.Columns.Add("FileName")


      Dim path As String = Server.MapPath("Images\Clients\")
      Dim di As New DirectoryInfo(path)
      Dim f As FileInfo
      For Each f In di.GetFiles
          arr = f.Name.Split(".")
          dt.Rows.Add(f.Name)

      Next
      lvAlbums.DataSource = dt
      lvAlbums.DataBind()



  End Sub



What I have tried:

i am using marquee but its not working like i need..

解决方案

please have a look on these links

Bootstrap Carousel Plugin [^]
Carousel[^]
How to Create Carousel with Bootstrap 3[^]


这篇关于在listview CSS中需要帮助来绑定图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆