Repeater

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

例:
 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ce.aspx.cs" Inherits="ce" %>

 <!DOCTYPE html>

 <html xmlns="http://www.w3.org/1999/xhtml">
 <head runat="server">
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title></title>
     <style>
         #ta
         {
             width:%;
             text-align:center;
         }
         #hea
         {
             background-color:blue;
         }
         .tr1{
             background-color:#c1e3ff;
         }
         .tr1:hover
         {
             background-color:#;
         }
         .tr2{
             background-color:#1fddff;
         }
         .tr2:hover
         {
             background-color:#;
         }
     </style>
 </head>
 <body>
     <form id="form1" runat="server">
         <div>
             <asp:Repeater ID="Repeater1" runat="server">
                 <HeaderTemplate>
                     <table id="ta">
                         <tr id="hea">
                             <td>编号</td>
                             <td>姓名</td>
                             <td>密码</td>
                             <td>昵称</td>
                             <td>性别</td>
                             <td>生日</td>
                             <td>民族</td>
                             <td>班级</td>
                         </tr>
                 </HeaderTemplate>
                 <ItemTemplate>
                         <tr class="tr1">
                             <td><%#Eval("Ids") %></td>
                             <td><%#Eval("UserName") %></td>
                             <td><%#Eval("PassWordStr") %></td>
                             <td><%#Eval("NickName") %></td>
                             <td><img src="<%#Eval("SexFile") %>" /></td>
                             <td><%#Eval("Birthdaystr") %></td>
                             <td style="<%#Eval("NationNameblu") %>"><%#Eval("NationName") %></td>
                             <td><%#Eval("ClassName") %></td>
                         </tr>
                 </ItemTemplate>
                 <AlternatingItemTemplate>
                         <tr class="tr2">
                             <td><%#Eval("Ids") %></td>
                             <td><%#Eval("UserName") %></td>
                             <td><%#Eval("PassWordStr") %></td>
                             <td><%#Eval("NickName") %></td>
                             <td><img src="<%#Eval("SexFile") %>" /></td>
                             <td><%#Eval("Birthdaystr") %></td>
                             <td style="<%#Eval("NationNameblu") %>"><%#Eval("NationName") %></td>
                             <td><%#Eval("ClassName") %></td>
                         </tr>
                 </AlternatingItemTemplate>
                 <FooterTemplate>
                     </table>
                 </FooterTemplate>
             </asp:Repeater>
         </div>
     </form>
 </body>
 </html>

.aspx

 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Web;
 using System.Web.UI;
 using System.Web.UI.WebControls;
 using WindowsFormsApplication1.App_Code;

 public partial class ce : System.Web.UI.Page
 {
     protected void Page_Load(object sender, EventArgs e)
     {
         Repeater1.DataSource = new UserData().Select();
         Repeater1.DataBind();
     }
 }

.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. bash/shell编程学习(3)

    接上节继续, 1. 从键盘读取输入内容 #!/bin/bash read -p 'please input something:' input echo 'your input:' $input 运行 ...

  2. Android 第三方图表类 MPChart 的使用

    先看看条形图的的效果还不错是吧,实现这样的效果很合适呢! 还有折线图.饼图很多效果 效果不错对吧~ 下面我们就先来看看条形图的实现方法吧! 第一步: 引入第三方包 MPChart 如果你碰巧看过我之前 ...

  3. 用上了ReSharper

    用上了ReSharper,发现很爽1.使用var2.去掉无用的using3.将foreach改为linq let4.字符串为cost5.作用域与变量名适配6.文件夹与namespace不匹配7.去掉为 ...

  4. [原创开源项目]EPUBBuilder一款在线的epub电子书编辑工具

    epub 感觉自己么么哒, epub书:国外最流行的电子书格式: epub电子书介绍: epub全称为Electronic Publication的缩写,意为:电子出版, epub于2007年9月成为 ...

  5. java-正则表达式过滤标签

    String str="one <a href=u.php?action=show&uid=122113 target=_blank>超链接文本</a> tw ...

  6. Android疑难杂症收集

    在渲染前获取 View 的宽高 5种手势工具类 软键盘用法总结 Android中Shape的使用 Android只能动态注册的广播Action Android 悬浮窗权限各机型各系统适配大全 录音权限 ...

  7. static实现单例的隐患

    1. 前言 Java的单例有多种实现方式:单线程下的简单版本.无法在指令重排序下正常工作的Double-Check.static.内部类+static.枚举--.这篇文章要讨论的,是在使用static ...

  8. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  9. UIDynamic--动力元素行为:UIDynamicItemBehavior

    属性分析: @property (nonatomic, readonly, copy) NSArray* items; @property (readwrite, nonatomic) CGFloat ...

  10. Masonry tableviewCell布局(转)

    转载自:http://www.henishuo.com/masonry-tableviewcell-layout/ 前言 说到iOS自动布局,有很多的解决办法.有的人使用xib/storyboard自 ...