Repeater导航菜单DataList产品展示
- <%@ 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产品展示的更多相关文章
- 【ASP.NET基础】简单企业产品展示网站--产品编辑CRUD
摘要:本文记录创建一个小的.简单的产品网站的步骤. 一,搭建一个简单的产品展示网站,熟悉以下知识点:NVelocity模板引擎.Ajax无刷新页面请求,文件上传,Row_Number实现分页,ckEd ...
- 干货分享!关于APP导航菜单设计你应该了解的一切
导航菜单是人机交互的最主要的桥梁和平台,主要作用是不让用户迷失方向.现在市面上产品的菜单栏种类繁多,到底什么样的才是优秀的导航菜单设计呢?好的菜单设计不仅能提升整个产品的用户体验,而且还能让用户耳目一 ...
- 精致3D图片切换效果,最适合企业产品展示
这是一个精致的立体图片切换效果,特别适合企业产品展示,可立即用于实际项目中.支持导航和自动播放功能, 基于 CSS3 实现,推荐使用最新的 Chrome,Firefox 和 Safari 浏览器浏览效 ...
- jQuery漂亮图标的垂直导航菜单
效果展示 http://hovertree.com/texiao/nav/3/ jQuery漂亮图标的垂直导航菜单 是一款当鼠标滑过菜单项时,会有一个背景遮罩层跟着鼠标移动,效果非常炫酷,图标还是矢量 ...
- jQuery弹性滑动导航菜单实现思路及代码
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <meta na ...
- web标准(复习)--4 纵向导航菜单及二级弹出菜单
今天我们开始学习纵向导航菜单及二级弹出菜单,包含以下内容和知识点: 纵向列表 标签的默认样式 css派生选择器 css选择器的分组 纵向二级列表 相对定位和绝对定位 一.纵向列表纵向列表或称为纵向导航 ...
- Jquery列表中的导航菜单的应用
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- ABP入门系列(6)——定义导航菜单
ABP入门系列目录--学习Abp框架之实操演练 完成了增删改查以及页面展示,这一节我们来为任务清单添加[导航菜单]. 在以往的项目中,大家可能会手动在layout页面中添加一个a标签来新增导航菜单,这 ...
- 固定底部导航菜单-续集(BottomMenu-移动端V3.0)
固定底部导航菜单-续集(BottomMenu-移动端V3.0) 适应在客户端,点击弹出二级菜单.因为手机不支持hover.所以使用click点击实现弹出菜单,并且一级菜单聚焦变色,变化背景图片 核心c ...
随机推荐
- paper 72 :高动态范围(HDR)图像 HDR (High Dynamic Range)
In standard rendering, the red, green and blue values for a pixel are each represented by a fraction ...
- paper 39 :Matlab绘制误差棒图(errorbar函数的使用)
同很多非数学相关专业的朋友一样,我第一次碰到这个图时也是丈二和尚摸不着头脑.只知道这个工字型的图案,中间的点代表的是平均值,上下的两条横线代表的是方差值,除此之外,连这个图叫什么名字都不知道,只好硬着 ...
- 夺命雷公狗---node.js---11之文件上传
我们在做文件上传前需要用npm来安装一个插件先, 首先打开项目所在的目录,然后按住shift键然后右键鼠标进入命令行安装formidable 然后开始编写上传的静态页面: <!DOCTYPE h ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON FillUp1
zw版[转发·台湾nvp系列Delphi例程]HALCON FillUp1 procedure TForm1.Button1Click(Sender: TObject);var img : HImag ...
- Sublime怎样新建HTML文档
1.在右下角有个plain text的标志,点击,选择文件类型为HTML 2.保存为HTML文档 3.这时候输入"!"(注意一定要选择对输入法) 4.然后按"Tab&qu ...
- centos 6 7更改主机名 命令添加ip
6:vi /etc/sysconfig/network 中hostname =主机名 vi /etc/hosts 添加127.0.0.1相应的主机名 7: hostnamectl set-hostn ...
- Python File.readlines() 方法
python3的用法:
- E2PROM与Flash的引脚图
E2PROM(24C02):
- DOS下如何同时显示时区日期和时间
DOS下如何同时显示时区日期和时间 Echo %Date:~0,4%-%Date:~5,2%-%Date:~8,2% %Time:~0,2%:%Time:~3,2% 不显示周几 Echo %Date: ...
- Intellij IDEA
http://1358440610-qq-com.iteye.com/blog/2102195