<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JD.aspx.cs" Inherits="WebApplication3.JD" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 237px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div> <table class="style1">
<tr>
<td class="style2">
<ul>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li>
<%# Eval("name") %>
<hr />
<asp:HiddenField ID="HiddenField1" Value='<%# Eval("id") %>' runat="server" />
<ul>
<asp:Repeater ID="Repeater2" runat="server">
<ItemTemplate>
<li>
<asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("id") %>' OnClick="ShowList" runat="server"><%# Eval("Name") %></asp:LinkButton>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</li> </ItemTemplate>
</asp:Repeater>
</ul>
</td>
<td>
<asp:DataList ID="DataList1" runat="server" CellPadding="4" ForeColor="#333333"
RepeatColumns="4">
<AlternatingItemStyle BackColor="White" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<ItemStyle BackColor="#E3EAEB" />
<ItemTemplate>
<table class="style1">
<tr>
<td>
<asp:Image ID="Image1" runat="server" Height="100px"
ImageUrl='<%# Eval("pic") %>' Width="100px" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("name") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
</asp:DataList>
</td>
</tr>
</table> </div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; namespace WebApplication3
{
public partial class JD : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BinList();
}
} public void ShowList(object sender, EventArgs e)
{
LinkButton lb= sender as LinkButton;
string id = lb.CommandArgument;
Response.Write("查询类别:" + id + "对应的商品");
string sql = "select * from goods where cid=" + id;
DataList1.DataSource = SQLHelper.GetTable(sql);
DataList1.DataBind();
} private void BinList()
{
string sql = "select * from goodsClass where pid=0";
Repeater1.DataSource = SQLHelper.GetTable(sql);
Repeater1.DataBind();
foreach (RepeaterItem item in Repeater1.Items)
{
string id = (item.FindControl("HiddenField1") as HiddenField).Value;
Repeater p2 = item.FindControl("Repeater2") as Repeater;
string s2 = "select * from goodsClass where pid=" + id;
p2.DataSource = SQLHelper.GetTable(s2);
p2.DataBind();
}
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; namespace WebApplication3
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ } protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox2.Text == "")
{
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false);
}
}
}
}

Repeater导航菜单DataList产品展示的更多相关文章

  1. 【ASP.NET基础】简单企业产品展示网站--产品编辑CRUD

    摘要:本文记录创建一个小的.简单的产品网站的步骤. 一,搭建一个简单的产品展示网站,熟悉以下知识点:NVelocity模板引擎.Ajax无刷新页面请求,文件上传,Row_Number实现分页,ckEd ...

  2. 干货分享!关于APP导航菜单设计你应该了解的一切

    导航菜单是人机交互的最主要的桥梁和平台,主要作用是不让用户迷失方向.现在市面上产品的菜单栏种类繁多,到底什么样的才是优秀的导航菜单设计呢?好的菜单设计不仅能提升整个产品的用户体验,而且还能让用户耳目一 ...

  3. 精致3D图片切换效果,最适合企业产品展示

    这是一个精致的立体图片切换效果,特别适合企业产品展示,可立即用于实际项目中.支持导航和自动播放功能, 基于 CSS3 实现,推荐使用最新的 Chrome,Firefox 和 Safari 浏览器浏览效 ...

  4. jQuery漂亮图标的垂直导航菜单

    效果展示 http://hovertree.com/texiao/nav/3/ jQuery漂亮图标的垂直导航菜单 是一款当鼠标滑过菜单项时,会有一个背景遮罩层跟着鼠标移动,效果非常炫酷,图标还是矢量 ...

  5. jQuery弹性滑动导航菜单实现思路及代码

    <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <meta na ...

  6. web标准(复习)--4 纵向导航菜单及二级弹出菜单

    今天我们开始学习纵向导航菜单及二级弹出菜单,包含以下内容和知识点: 纵向列表 标签的默认样式 css派生选择器 css选择器的分组 纵向二级列表 相对定位和绝对定位 一.纵向列表纵向列表或称为纵向导航 ...

  7. Jquery列表中的导航菜单的应用

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  8. ABP入门系列(6)——定义导航菜单

    ABP入门系列目录--学习Abp框架之实操演练 完成了增删改查以及页面展示,这一节我们来为任务清单添加[导航菜单]. 在以往的项目中,大家可能会手动在layout页面中添加一个a标签来新增导航菜单,这 ...

  9. 固定底部导航菜单-续集(BottomMenu-移动端V3.0)

    固定底部导航菜单-续集(BottomMenu-移动端V3.0) 适应在客户端,点击弹出二级菜单.因为手机不支持hover.所以使用click点击实现弹出菜单,并且一级菜单聚焦变色,变化背景图片 核心c ...

随机推荐

  1. zw版【转发·台湾nvp系列Delphi例程】HALCON Histogram

    zw版[转发·台湾nvp系列Delphi例程]HALCON Histogram unit Unit1;interfaceuses Windows, Messages, SysUtils, Varian ...

  2. android 项目学习随笔十五(ShareSDK开放平台)

    ShareSDK开放平台http://www.mob.com/#/

  3. 记录下标准网线水晶头的做法 100m/1G

    注意, 网线分平行线(也叫直连线)和交叉线.  用法见下图 .也就是相同层内用交叉线, 不同层用平行线.  所以两台电脑,两台非级联并行的路由才用交叉线,一般我们都用平行线即可. 千兆网和百兆网不同: ...

  4. mysql字符串相关

    使用MySQL,我们很多时候都会出现需要截取字符串的情况,所以关于字符串的截取的方式有必要记录下去. MySQL截取字符串的函数有: left(str, length):从左边开始截取,length是 ...

  5. 怎样使用AutoLayOut为UIScrollView添加约束

    1.在ViewController中拖入1个UIScrollView,并为其添加约束 约束为上下左右四边与superview对齐 2.在scrollview中,拖入1个UIView,为了便于区分将其设 ...

  6. asp显示多条记录的代码

    asp显示多条记录的代码 仅供参考 <%for i=1 to RS.PageSize%> <% if RS.EOF then exit for end if %> <tr ...

  7. Oracle 11gR2新建空表不分配Segment

    一.引言: 在看<收获,不止Oracle>的神奇,走进逻辑体系世界一章时,需要新建一张表查看Extents的情况,由于该书的环境是ORACLE10G的,因此新建空表以后立刻就分配Segme ...

  8. Hive文件格式

    hive文件存储格式包括以下几类: 1.TEXTFILE 2.SEQUENCEFILE 3.RCFILE 4.ORCFILE(0.11以后出现) 其中TEXTFILE为默认格式,建表时不指定默认为这个 ...

  9. MySQL存储引擎之InnoDB

    一.The InnoDB Engine Each InnoDB table is represented on disk by an .frm format file in the database ...

  10. Python字符界面函数库

    curses ncurses prettytable from prettytable import PrettyTable row = PrettyTable() row.field_names = ...