ListView搭配DataPager控件实现分页
实现了IPageableItemContainer接口的控件可以使用DataPager进行分页
但是ASP.NET中目前只有ListView实现了这个接口
①将DataPager声明到ListView中来用,在LayoutTemplate中
在ListView的配置中就启用分页,会自动在LayoutTemplate中会生成相应的代码、
②单独地声明DataPager
设置PagedControlID来关联相应的ListView
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
</Fi
实现了IPageableItemContainer接口的控件可以使用DataPager进行分页
但是ASP.NET中目前只有ListView实现了这个接口
①将DataPager声明到ListView中来用,在LayoutTemplate中
在ListView的配置中就启用分页,会自动在LayoutTemplate中会生成相应的代码、
②单独地声明DataPager
设置PagedControlID来关联相应的ListView
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
</Fi