asp.net 三层机构repeater 怎么分页动态的

qq_41009232 qq_41009232 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
前台代码
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="Content3">
<hr style="border :1px solid grey"/>
<h3>产品介绍</h3>
<div>
产品搜索:<asp:TextBox ID="txtname" placeholder="请输入搜索信息" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="搜索" OnClick="Button1_Click" />
</div>
<p style="text-align:center">
<a href="product.aspx?gname=铝合金水平尺">铝合金水平尺</a>|
<a href='product.aspx?gname=鱼雷式水平尺' >鱼雷式水平尺</a>|
<a href='product.aspx?gname=测量工具'>测量工具</a>|
<a href='product.aspx?gname=其他' >其他</a>
</p>
<asp:Repeater ID="rpproduct" runat="server">
<ItemTemplate>
<dl>
<dt><a href='Productdetail.aspx?shopname=<%#Eval("ShopName") %>'>
<img src="Images/<%#Eval("shoppicture") %>" /></a></dt>
<dd class="dq_introduce"><%#Eval("ShopName") %>
</dd>
<dd class="dq_price">¥<%#Eval("ShopPrice") %></dd>
</dl>
</ItemTemplate>
</asp:Repeater>


</div>
<div id="footpages">
<a href="product.aspx?pages=1"onclick="">上一页</a>
<a href="product.aspx?pages=2"onclick="">下一页</a>
</div>
</asp:Content>
后台代码
void loadpage()
{
string typename = Request.QueryString["gname"];
string page5 = Request.QueryString["pages"];
int pages;
int rows =8;
if (page5 == null)
{
pages =1;
if (typename == null)
typename = "铝合金水平尺";
//Total t = shopBLL.selectShopTotalBLL(typename);
//int totala = t.Totals;
this.rpproduct.DataSource = shopBLL.selectShopPageBLL(rows, pages, typename);
this.rpproduct.DataBind();
}
else
{
pages = int.Parse(page5);
if (typename == null)
typename = "铝合金水平尺";
//shopBLL.selectShopTotalBLL(typename);
this.rpproduct.DataSource = shopBLL.selectShopPageBLL(rows, pages, typename);
this.rpproduct.DataBind();
}我现在是写死了怎么写动态的
...全文

相关推荐

ASP.NET Repeater 简单增删改查分页例子

ASP.NET Repeater 简单的增删改查分页例子(附数据库,下载即可运行),适合新手使用,本例使用三层架构搭建,实现增删该查以及分页功能,代码简洁,注释详细,欢迎大家下载使用。

隔壁老陈同志

ASP.NET Repeater分页,查询分页

ASP.NET Repeater分页,查询分页 ASP.NET Repeater分页,查询分页 ASP.NET Repeater分页,查询分页 ASP.NET Repeater分页,查询分页 ASP.NET Repeater分页,查询分页

兔子党

ASP.NET程序中用Repeater实现分页

一、程序功能:  为Repeater实现分页    二、窗体设计:  1、新建ASP.NET Web应用程序,命名为Repeater2,保存路径为http://192.168.0.1/Repeater2(注:我机子上的网站的IP是192.168.0.1的主目录是D:\web文件夹)然后点击确定。    2、向窗体添加一个3行一列的表,向表的第一行中添加一个Repeater控件,向表的第二行中添加两个Label控件向表的第三行中添加四个Button按钮。    3、切换到HTML代码窗口,在<asp:Repeater id=”Repeater1″ runat=”server”>和</asp:Re

代码加烟,法力无边

asp.net Repeater之非常好的数据分页

分页控件源代码如下: 代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections; #region Assembly Resource Attribute [assembly: System.Web.UI.WebResource(“WebControlLibr

weixin_38664469

asp.net下Repeater使用 AspNetPager分页控件

一、AspNetPager分页控件 分页是Web应用程序中最常用到的功能之一,在ASP.NET中,虽然自带了一个可以分页的DataGrid(asp.net 1.1)和GridView(asp.net 2.0)控件,但其分页功能并不尽如人意,如可定制性差、无法通过Url实现分页功能等,而且有时候我们需要对DataList和Repeater甚至自定义数据绑定控件进行分页,手工编写分页代码不但技术难度大、任务繁琐而且代码重用率极低,因此分页已成为许多ASP.NET程序员最头疼的问题之一。 AspNetPager针对ASP.NET分页控件的不足,提出了与众不同的解决asp.net中分页问题的方案,即将

weixin_38518668
评论 7
收藏 已收藏
分享
返回顶部
qq_41009232
.NET社区 62,274 成员 668,968 内容