Repeater嵌套Repeater
<asp:Repeater ID="rptXiaoLei" runat="server" OnItemDataBound="rptXiaoLei_ItemDataBound">
<ItemTemplate>
<a href='<%#Eval("columnbh") %><%#Eval("areaId") %><%#Eval("wptype") %>'></a>
<%--传参用--%>
<div class="beauty_f">
<div class="top">
<div class="name">
<a href='listShop.aspx?columnbh=<%#Eval("columnbh") %>&areaId=<%#Eval("areaId") %>&wptype=<%#Eval("wptype") %>'>
<%#Eval("cname") %></a>
</div>
<div id='<%#Eval("columnbh") %>' style="float: left;">
</div>
<div class="more">
<a href='listShop.aspx?columnbh=<%#Eval("columnbh") %>&areaId=<%#Eval("areaId") %>&wptype=<%#Eval("wptype") %>'>
more</a>
</div>
</div>
<div class="content" style="height: auto;">
<div class="content_a" style="height: auto;">
<ul style="width: 930px; height: auto;">
<asp:Repeater ID="rptShangPin" runat="server">
<ItemTemplate>
<li style="width: 180px; float: left;">[<%# GetFirstAreaName(Convert.ToString(Eval("area1Id"))) %>]<a href='detail.aspx?id=<%#Eval("id") %>'
title='<%#Eval("title") %>'><%# CutString(Convert.ToString(Eval("title")),18)%></a>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
cs页代码:
protected void rptXiaoLei_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rptShangPin = e.Item.FindControl("rptShangPin") as Repeater;//找到里层的repeater对象
DataRowView rowv = (DataRowView)e.Item.DataItem;//找到分类Repeater关联的数据项
string columnbh = rowv["columnbh"].ToString();//获取填充子类的id
string areaId = rowv["areaId"].ToString();
string wptype = rowv["wptype"].ToString();
//每个栏目下显示多少条商品,在这里手动修改
shopTab = shopAda.GetDataByNumHangyeAreaId("55", columnbh, areaId, wptype);
rptShangPin.DataSource = shopTab;
rptShangPin.DataBind();
}
}
Repeater嵌套Repeater的更多相关文章
- Repeater嵌套Repeater并取得嵌套Repeater里面的控件
前台代码: <asp:Repeater ID="RepeaterScene" runat="server" OnItemDataBound=&quo ...
- ASP.NET Repeater嵌套Repeater实现菜单加载
在KS系统中要实现从数据库中读取界面权限文件实现菜单.界面的动态加载. 效果图: ASP.NET界面代码 <div id="menu-container"> <a ...
- Repeater嵌套(灵活的)
页面代码 <form id="form1" runat="server"> <asp:Repeater ID="rptCategor ...
- 关于Repeater嵌套绑定的问题
前台代码: <div id="firstpane" class="menu_list"> <asp:Repeat ...
- DataList与Repeater嵌套绑定
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs&quo ...
- asp.net:repeater嵌套(常用于新闻等在首页归类显示)
using System;using System.Configuration;using System.Collections.Generic;using System.Linq;using Sys ...
- C# Repeater 嵌套
<table class="table table-bordered table-fixed"> <thead> <tr> <th wid ...
- Repeater 嵌套,子级Repeater获取 父级Repeater 中的值
第一种方法,子级Repeater中绑定父级的某个字段: <%# DataBinder.Eval((Container.NamingContainer.NamingContainer as Rep ...
- Repeater嵌套绑定Repeater
前台Html代码 <asp:Repeater runat="server" ID="rpList" OnItemDataBound="rpLis ...
随机推荐
- Nginx的ip_hash指令
ip_hash 语法:ip_hash 默认值:none 使用环境:upstream 当对后端的多台动态应用服务器做负载均衡时,ip_hash指令能够将某个客户端IP的请求通过哈希算法定位到同一台后端服 ...
- 利用Red Blob游戏介绍A*算法
转自:http://gad.qq.com/program/translateview/7194337 在游戏中,我们经常想要找到从一个位置到另一个位置的路径.我们不只是想要找到最短距离,同时也要考虑旅 ...
- sql isdate判断时间函数(小技巧)
isdate 是一个判断字符串是否为日期的函数,0代表所传入的字符串不是日期,1代表传入的参数是日期. select isdate('30/12/2014') ---0 第一个是 mdy --如 ...
- node和yarn
nvm 版本管理工具 https://github.com/coreybutler/nvm-windows/releases nvm-setup nvm install +版本号 加版本 ...
- python写个御剑
前言: 今天师傅叫我,写个python版的御剑.然后我之前也写过 不过不怎么样,这次有新想法. 思路: 御剑:读取御剑配置文件里的所有路径,加上用户要扫描的url.进行批量检测,如果状态码为200并且 ...
- C# 日志记录工具类--LogHelper.cs测试
C# 日志记录工具类:(适用于不想使用log4j等第三方的Log工具的时候,希望自己写个简单类实现)LogHelper.cs内容如下: using System; using System.Diagn ...
- tomcat启动原理
2018年04月12日 19:55:22 太极小帅帅 阅读数:282 前言 一直在用Tomcat,但是对其启动原理一直没去研究,这里准备去面试,可能会问道.于是总结了下启动原理.完全凭感觉去揣测, ...
- centos7配置vsftpd服务器
参考网站:https://blog.csdn.net/lianghongge/article/details/78209445 ==================================== ...
- Java工具类实现校验公民身份证的有效性
转自:https://www.oschina.net/code/snippet_1859292_39120 1 package com.tg.user.controller; import java. ...
- reportng代替testng的默认报告——pom设置
既然是maven项目,直接关注pom设置. 这篇写得很清楚了:maven+testng+reportng的pom设置 强调一点的是,guice必须依赖,就因这个卡了大半天. <dependenc ...