Repeater

   Repeater支持以下5种模板 
      ● ItemTemplate : 对每一个数据项进行格式设置 【Formats each item from the data source.】 
      ● AlternatingItemTemplate : 对交替数据项进行格式设置 
      ● SeparatorTemplate : 对分隔符进行格式设置 
      ● HeaderTemplate : 对页眉进行格式设置 
      ● FooterTemplate : 对页脚进行格式设置

  1. 例:
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ce.aspx.cs" Inherits="ce" %>
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <title></title>
  9. <style>
  10. #ta
  11. {
  12. width:%;
  13. text-align:center;
  14. }
  15. #hea
  16. {
  17. background-color:blue;
  18. }
  19. .tr1{
  20. background-color:#c1e3ff;
  21. }
  22. .tr1:hover
  23. {
  24. background-color:#;
  25. }
  26. .tr2{
  27. background-color:#1fddff;
  28. }
  29. .tr2:hover
  30. {
  31. background-color:#;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <form id="form1" runat="server">
  37. <div>
  38. <asp:Repeater ID="Repeater1" runat="server">
  39. <HeaderTemplate>
  40. <table id="ta">
  41. <tr id="hea">
  42. <td>编号</td>
  43. <td>姓名</td>
  44. <td>密码</td>
  45. <td>昵称</td>
  46. <td>性别</td>
  47. <td>生日</td>
  48. <td>民族</td>
  49. <td>班级</td>
  50. </tr>
  51. </HeaderTemplate>
  52. <ItemTemplate>
  53. <tr class="tr1">
  54. <td><%#Eval("Ids") %></td>
  55. <td><%#Eval("UserName") %></td>
  56. <td><%#Eval("PassWordStr") %></td>
  57. <td><%#Eval("NickName") %></td>
  58. <td><img src="<%#Eval("SexFile") %>" /></td>
  59. <td><%#Eval("Birthdaystr") %></td>
  60. <td style="<%#Eval("NationNameblu") %>"><%#Eval("NationName") %></td>
  61. <td><%#Eval("ClassName") %></td>
  62. </tr>
  63. </ItemTemplate>
  64. <AlternatingItemTemplate>
  65. <tr class="tr2">
  66. <td><%#Eval("Ids") %></td>
  67. <td><%#Eval("UserName") %></td>
  68. <td><%#Eval("PassWordStr") %></td>
  69. <td><%#Eval("NickName") %></td>
  70. <td><img src="<%#Eval("SexFile") %>" /></td>
  71. <td><%#Eval("Birthdaystr") %></td>
  72. <td style="<%#Eval("NationNameblu") %>"><%#Eval("NationName") %></td>
  73. <td><%#Eval("ClassName") %></td>
  74. </tr>
  75. </AlternatingItemTemplate>
  76. <FooterTemplate>
  77. </table>
  78. </FooterTemplate>
  79. </asp:Repeater>
  80. </div>
  81. </form>
  82. </body>
  83. </html>

.aspx

  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. using WindowsFormsApplication1.App_Code;
  8.  
  9. public partial class ce : System.Web.UI.Page
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. Repeater1.DataSource = new UserData().Select();
  14. Repeater1.DataBind();
  15. }
  16. }

.aspx.cs

Request

  Request.QueryString :获取地址栏参数(以GET方式提交的数据)

  地址后面接  ?key=value&key=value

  Request.QueryString方法还会把数据信息显示在客户端浏览器地址栏中,安全性较差。

 

  获取请求对象    Request["key"]

专门用来获取传递过来的值
1、获取地址栏传递过来的参数值 get
2、获取表单提交过来的参数值 post

Response: - 响应请求对象

Response.Redirect("路径?key=value");

Response.Write("打印的HTML");
Response.Write("<script>alert('哈哈哈哈哈');</script>");

Repeater、地址栏传值、Response--2016年12月30日的更多相关文章

  1. 2016年12月30日 星期五 --出埃及记 Exodus 21:25

    2016年12月30日 星期五 --出埃及记 Exodus 21:25 burn for burn, wound for wound, bruise for bruise.以烙还烙,以伤还伤,以打还打 ...

  2. 2016年12月31日 星期六 --出埃及记 Exodus 21:26

    2016年12月31日 星期六 --出埃及记 Exodus 21:26 "If a man hits a manservant or maidservant in the eye and d ...

  3. 2016年12月29日 星期四 --出埃及记 Exodus 21:24

    2016年12月29日 星期四 --出埃及记 Exodus 21:24 eye for eye, tooth for tooth, hand for hand, foot for foot,以眼还眼, ...

  4. 2016年12月28日 星期三 --出埃及记 Exodus 21:23

    2016年12月28日 星期三 --出埃及记 Exodus 21:23 But if there is serious injury, you are to take life for life,若有 ...

  5. 2016年12月27日 星期二 --出埃及记 Exodus 21:22

    2016年12月27日 星期二 --出埃及记 Exodus 21:22 "If men who are fighting hit a pregnant woman and she gives ...

  6. c++中变量声明和变量定义的区别。2016年12月6日

    整个流程: 1.程序告诉cpu,程序将要使用一个变量.(暂时不一定用到,先说一下.) 2.程序告诉CPU,程序现在就要使用一个变量.(现在就用) 3.cpu按照这个变量的类型,把内存划分出几个单位(b ...

  7. 2016年12月26日 星期一 --出埃及记 Exodus 21:21

    2016年12月26日 星期一 --出埃及记 Exodus 21:21 but he is not to be punished if the slave gets up after a day or ...

  8. 2016年12月25日 星期日 --出埃及记 Exodus 21:20

    2016年12月25日 星期日 --出埃及记 Exodus 21:20 "If a man beats his male or female slave with a rod and the ...

  9. 2016年12月24日 星期六 --出埃及记 Exodus 21:19

    2016年12月24日 星期六 --出埃及记 Exodus 21:19 the one who struck the blow will not be held responsible if the ...

随机推荐

  1. C#进阶系列——WebApi 身份认证解决方案:Basic基础认证

    前言:最近,讨论到数据库安全的问题,于是就引出了WebApi服务没有加任何验证的问题.也就是说,任何人只要知道了接口的url,都能够模拟http请求去访问我们的服务接口,从而去增删改查数据库,这后果想 ...

  2. jQuery Ajax传值给Servlet,在Servlet里Get接受参数乱码的解决方法

    最近在学jquery ui,在做一个小功能的时候需要将前台的值获取到,通过Ajax传递给Servlet,然后再在返回数据结果,但是在Servlet接受参数的时候,通过后台打印,发现接受乱码,代码示例如 ...

  3. C# 提交网页请求时出现如下错误: System.Net.WebException: 操作超时

    原因一: 连接超时时间 Timeout 以及写入Post数据超时时间 ReadWriteTimeout 设置得太短,一般要设置大于6000ms. 原因二: Expect100Continue 属性的值 ...

  4. CentOS下配置java环境变量classpath

    一. 需要配置的环境变量1. PATH环境变量.作用是指定命令搜索路径,在shell下面执行命令时,它会到PATH变量所指定的路径中查找看是否能找到相应的命令程序.我们需要把 jdk安装目录下的bin ...

  5. cocos2d-x内存管理

    Cocos2d-x内存管理 老师让我给班上同学讲讲cocos2d-x的内存管理,时间也不多,于是看了看源码,写了个提纲和大概思想 一.   为什么需要内存管理 1. new和delete 2. 堆上申 ...

  6. Datatables事件

    DataTables格式化渲染加上的html代码按一般方式绑定事件可能会没效果,通过以下方式可以解决 $(document).on("click","#checkchil ...

  7. 将上传图片转成base64(转)

    效果如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8"><titl ...

  8. fsr

    Front-end server render 前端在后端的渲染 1.采用express框架创建项目 express -e fsr cd fsr npm install 2.模板选用artTempla ...

  9. cent6.4使用

    让centos能够上网 刚安装了时,是不能联网的,我们可以通过以下命令更改即可: cd /etc/sysconfig/network-script vi ifcfg-eth0 更改其中的ONBOOT= ...

  10. Python Day17

    jQuery jQuery是一个兼容多浏览器的javascript库,核心理念是write less,do more(写得更少,做得更多),对javascript进行了封装,是的更加便捷的开发,并且在 ...