1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JD.aspx.cs" Inherits="WebApplication3.JD" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7. <title></title>
  8. <style type="text/css">
  9. .style1
  10. {
  11. width: 100%;
  12. }
  13. .style2
  14. {
  15. width: 237px;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <form id="form1" runat="server">
  21. <div>
  22.  
  23. <table class="style1">
  24. <tr>
  25. <td class="style2">
  26. <ul>
  27. <asp:Repeater ID="Repeater1" runat="server">
  28. <ItemTemplate>
  29. <li>
  30. <%# Eval("name") %>
  31. <hr />
  32. <asp:HiddenField ID="HiddenField1" Value='<%# Eval("id") %>' runat="server" />
  33. <ul>
  34. <asp:Repeater ID="Repeater2" runat="server">
  35. <ItemTemplate>
  36. <li>
  37. <asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("id") %>' OnClick="ShowList" runat="server"><%# Eval("Name") %></asp:LinkButton>
  38. </li>
  39. </ItemTemplate>
  40. </asp:Repeater>
  41. </ul>
  42. </li>
  43.  
  44. </ItemTemplate>
  45. </asp:Repeater>
  46. </ul>
  47. </td>
  48. <td>
  49. <asp:DataList ID="DataList1" runat="server" CellPadding="4" ForeColor="#333333"
  50. RepeatColumns="4">
  51. <AlternatingItemStyle BackColor="White" />
  52. <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
  53. <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
  54. <ItemStyle BackColor="#E3EAEB" />
  55. <ItemTemplate>
  56. <table class="style1">
  57. <tr>
  58. <td>
  59. <asp:Image ID="Image1" runat="server" Height="100px"
  60. ImageUrl='<%# Eval("pic") %>' Width="100px" />
  61. </td>
  62. </tr>
  63. <tr>
  64. <td>
  65. <asp:Label ID="Label1" runat="server" Text='<%# Eval("name") %>'></asp:Label>
  66. </td>
  67. </tr>
  68. </table>
  69. </ItemTemplate>
  70. <SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
  71. </asp:DataList>
  72. </td>
  73. </tr>
  74. </table>
  75.  
  76. </div>
  77. </form>
  78. </body>
  79. </html>
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace WebApplication3
  9. {
  10. public partial class JD : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. if (!IsPostBack)
  15. {
  16. BinList();
  17. }
  18. }
  19.  
  20. public void ShowList(object sender, EventArgs e)
  21. {
  22. LinkButton lb= sender as LinkButton;
  23. string id = lb.CommandArgument;
  24. Response.Write("查询类别:" + id + "对应的商品");
  25. string sql = "select * from goods where cid=" + id;
  26. DataList1.DataSource = SQLHelper.GetTable(sql);
  27. DataList1.DataBind();
  28. }
  29.  
  30. private void BinList()
  31. {
  32. string sql = "select * from goodsClass where pid=0";
  33. Repeater1.DataSource = SQLHelper.GetTable(sql);
  34. Repeater1.DataBind();
  35. foreach (RepeaterItem item in Repeater1.Items)
  36. {
  37. string id = (item.FindControl("HiddenField1") as HiddenField).Value;
  38. Repeater p2 = item.FindControl("Repeater2") as Repeater;
  39. string s2 = "select * from goodsClass where pid=" + id;
  40. p2.DataSource = SQLHelper.GetTable(s2);
  41. p2.DataBind();
  42. }
  43. }
  44. }
  45. }

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace WebApplication3
  9. {
  10. public partial class Login : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14.  
  15. }
  16.  
  17. protected void Button1_Click(object sender, EventArgs e)
  18. {
  19. if (TextBox2.Text == "")
  20. {
  21. System.Web.Security.FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false);
  22. }
  23. }
  24. }
  25. }

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. 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 ...

  2. paper 39 :Matlab绘制误差棒图(errorbar函数的使用)

    同很多非数学相关专业的朋友一样,我第一次碰到这个图时也是丈二和尚摸不着头脑.只知道这个工字型的图案,中间的点代表的是平均值,上下的两条横线代表的是方差值,除此之外,连这个图叫什么名字都不知道,只好硬着 ...

  3. 夺命雷公狗---node.js---11之文件上传

    我们在做文件上传前需要用npm来安装一个插件先, 首先打开项目所在的目录,然后按住shift键然后右键鼠标进入命令行安装formidable 然后开始编写上传的静态页面: <!DOCTYPE h ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON FillUp1 procedure TForm1.Button1Click(Sender: TObject);var img : HImag ...

  5. Sublime怎样新建HTML文档

    1.在右下角有个plain text的标志,点击,选择文件类型为HTML 2.保存为HTML文档 3.这时候输入"!"(注意一定要选择对输入法) 4.然后按"Tab&qu ...

  6. centos 6 7更改主机名 命令添加ip

    6:vi /etc/sysconfig/network 中hostname =主机名 vi /etc/hosts  添加127.0.0.1相应的主机名 7: hostnamectl set-hostn ...

  7. Python File.readlines() 方法

    python3的用法:

  8. E2PROM与Flash的引脚图

    E2PROM(24C02):

  9. DOS下如何同时显示时区日期和时间

    DOS下如何同时显示时区日期和时间 Echo %Date:~0,4%-%Date:~5,2%-%Date:~8,2% %Time:~0,2%:%Time:~3,2% 不显示周几 Echo %Date: ...

  10. Intellij IDEA

    http://1358440610-qq-com.iteye.com/blog/2102195