Repeater、地址栏传值、Response--2016年12月30日
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日的更多相关文章
- 2016年12月30日 星期五 --出埃及记 Exodus 21:25
2016年12月30日 星期五 --出埃及记 Exodus 21:25 burn for burn, wound for wound, bruise for bruise.以烙还烙,以伤还伤,以打还打 ...
- 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 ...
- 2016年12月29日 星期四 --出埃及记 Exodus 21:24
2016年12月29日 星期四 --出埃及记 Exodus 21:24 eye for eye, tooth for tooth, hand for hand, foot for foot,以眼还眼, ...
- 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,若有 ...
- 2016年12月27日 星期二 --出埃及记 Exodus 21:22
2016年12月27日 星期二 --出埃及记 Exodus 21:22 "If men who are fighting hit a pregnant woman and she gives ...
- c++中变量声明和变量定义的区别。2016年12月6日
整个流程: 1.程序告诉cpu,程序将要使用一个变量.(暂时不一定用到,先说一下.) 2.程序告诉CPU,程序现在就要使用一个变量.(现在就用) 3.cpu按照这个变量的类型,把内存划分出几个单位(b ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- [LeetCode] Word Pattern II 词语模式之二
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full mat ...
- [LeetCode] Reverse Nodes in k-Group 每k个一组翻转链表
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If ...
- markdown语法说明
1.先写一个标题 # 一级标题.相当于 <h1> ## 二级标题.相当于 <h2> ### 三级标题.相当于 <h3> #### 四级标题.相当于 <h4&g ...
- Spring在非web应用中关闭IoC容器 (registerShutdownHook)
在基于web的ApplicationContext实现中,已有相应的实现来处理关闭web应用时恰当地关闭Spring IoC容器.但,如果你正在一个非web应用的环境下使用Spring的IoC容器,如 ...
- [转]如何设置eclipse中js默认打开为java Editor
打开window-preference -> General-Editors-File Associator 看到右边的.js下边就是设置默认打开方式了 转自百度知道:http://zhidao ...
- c# String.Join 和 Distinct 方法 去除字符串中重复字符
1.在写程序中经常操作字符串,需要去重,以前我的用方式利用List集合和 contains去重复数据代码如下: string test="123,123,32,125,68,9565,432 ...
- ios学习资源
1.BigShow学习Demo集合 https://github.com/BigShow1949/BigShow1949 2.[干货]一行代码实现自定义转场动画http://www.cocoachin ...
- Codeforces Round #384 (Div. 2) B. Chloe and the sequence(规律题)
传送门 Description Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems ...
- AnjularJS系列1 —— 样式相关的指令
最近,开始学习AngularJS. 开始记录学习AngularJS的过程,从一些很简单的知识点开始. 习惯先从实际应用的指令开始,再从应用中去体会AngularJS的优缺点.使用的场景等. 之前一直希 ...
- oracle中临时表是用来做什么的
oracle中临时表是用来做什么的 某些情况下, 需要 多个非常大的表关联的情况下, 但是需要检索的, 是少量的数据的时候.可以先把 大表的数据, 检索出那一小部分, 然后插入到 临时表中, 最后再关 ...