如何在不分页的情况下限制数据列表中没有图像? [英] how to restrict no of images in datalist without paging?
问题描述
嗨...我正在像滚动条一样水平使用数据列表,其在asp.net中的编码如下所示...
Hi... i am using datalist horizontally like a scroll with its coding in asp.net as following...
<ul id="my-list" style="width: auto">
<asp:DataList ID="DLJOU" runat="server" EmptyDataText="No Data Found" BackColor="#000000" Style="margin-bottom: 0px" RepeatDirection="Horizontal" Width="120px" OnItemDataBound="DLJOU_ItemDataBound">
<ItemTemplate>
<li class="item">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "javascript:getJourneyData("+ Eval("ID") +")" %>'Text="" Target="_top" ImageUrl='<% #Eval("staticmapurl") %>'></asp:HyperLink>
<%# formattext(DataBinder.Eval(Container.DataItem, "Title").ToString())%>
</li>
</ItemTemplate>
</asp:DataList>
</ul>
和图像大约35左右...和我两端都有箭头,并且它在鼠标上滚动到结束..将来可能会增加,所以我希望滚动仅适用于abt 15图像,然后我要显示其余的当我单击查看全部"按钮时,我想在垂直数据列表或gridview中显示它们.因此,您能告诉我如何在不进行分页的情况下限制水平数据列表中的图像吗?
预先感谢您.
and the images are about 35 or so...and i have arrow on both ends and it scrolls on mouse over till end.. that may increase in future so i want the scroll to work only for abt 15 images then i want to display the rest when i click on the View all button i want to show them in a vertical datalist or gridview. So, can u please tell me how to restrict images in the horizontal datalist without paging.
Thanking You in advance.
推荐答案
使用DataList是唯一的使用分页的方法.这就是功能的目的.
否则,创建一个div并通过AJAX调用填充它.有许多可用的图像轮播示例,可以使用AJAX通过JavaScript动态加载/创建HTML
Using a DataList as you are the only way is to use paging. That is the purpose for the functionality.
Otherwise, create a div and populate it via an AJAX call. There are many examples of image carousels available and dynamically loading/creating HTML via JavaScript using AJAX
这篇关于如何在不分页的情况下限制数据列表中没有图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!