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. C语言中函数的传入值与传出值

    看到一个函数的原型后,怎么样一眼看出来哪个参数做输入哪个做输出? 函数传参如果传的是普通变量(不是指针)那肯定是输入型参数: 如果传指针就有 2 种可能性了,为了区别,经常的做法是: 如果这个参数是做 ...

  2. Objective-c快速入门

    对象(Class)的声明和定义 和其他的语言不同,OC的对象创建分为两个部分.声明部分(@interface)和实现部分(@implementation),且它们都必须使用@end结束. 对象的声明( ...

  3. Spring中配置数据源的4种形式

    不管采用何种持久化技术,都需要定义数据源.Spring中提供了4种不同形式的数据源配置方式: spring自带的数据源(DriverManagerDataSource),DBCP数据源,C3P0数据源 ...

  4. WebStorm 2016.2.3的安装与汉化

    WebStorm是一款功能出色的JavaScript开发工具.号称是""Web前端开发神器"."最强大的HTML5编辑器"."最智能的Jav ...

  5. 日历插件FullCalendar应用:(二)数据增删改

    接上一篇 日历插件FullCalendar应用:(一)数据展现. 这一篇主要讲使用fullcalendar插件如何做数据的增删改,用到了art.dialog web对话框组件,上一篇用到的webFor ...

  6. 测试或运维工作过程中最常用的几个linux命令?

     大家在测试工作过程中,可能会遇到需要你去服务器修改一些配置文件,譬如说某个字段的值是1 则关联老版本,是0则关联新版本,这时候你可能就需要会下vi的命令操作:或者查看session设置的时长,可能需 ...

  7. Django知识点整理

    什么是web框架 框架,即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用框架可以帮你快速开发特定的系统,简单地说,就是你用别人搭建好的舞台来做表演. web应用 访 ...

  8. Bzoj3450 Tyvj1952 Easy

    Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 570  Solved: 428[Submit][Status][Discuss] Descriptio ...

  9. ReactNative 分享解决listView的一个郁闷BUG

    用ListView的时候,会出现一个非常傻bi的情况,就是render的时候,listView不显示,需要碰/滑一下才会显示. 一开始我在怀疑自己是不是布局哪里有冲突,改到哭都没发现布局有什么问题,直 ...

  10. asp.net mvc bootstrap datatable 服务端分页

    datatable 服务端分页 因项目需求变动,需处理大量数据,更改成服务端分页,自己两天的学习笔记 先上图[ jqueryui风格] 前端代码: @{ Layout = null;} <!DO ...