后台CS代码:

namespace WebFormTest.TestCollect
{
public partial class ListTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
List<Person> list1 = new List<Person>();
list1.Add(new Person() { Age = , Name = "张三", Time = Convert.ToDateTime("2013/12/20 13:20") });
list1.Add(new Person() { Age = , Name = "李四", Time = Convert.ToDateTime("2013/12/20 14:20") });
list1.Add(new Person() { Age = , Name = "王五", Time = Convert.ToDateTime("2013/12/20 13:40") }); List<Person> list2 = new List<Person>();
list2.Add(new Person() { Age = , Name = "张三2", Time = Convert.ToDateTime("2013/12/20 13:20") });
list2.Add(new Person() { Age = , Name = "李四2", Time = Convert.ToDateTime("2013/12/20 14:20") });
list2.Add(new Person() { Age = , Name = "王五2", Time = Convert.ToDateTime("2013/12/20 13:40") }); list1 = list1.Concat(list2).ToList(); //合并多个list<T> list1 = list1.OrderByDescending(i => i.Time).ToList(); //降序排列
//list.OrderBy(i => i.Time);升序排列 Repeater1.DataSource = list1;
Repeater1.DataBind();
}
} public class Person
{
private int age; public int Age
{
get { return age; }
set { age = value; }
}
private string name; public string Name
{
get { return name; }
set { name = value; }
} private DateTime time; public DateTime Time
{
get { return time; }
set { time = value; }
} }
}

前台代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListTest.aspx.cs" Inherits="WebFormTest.TestCollect.ListTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<tr>
<td>
<%#Eval("Age") %>
</td>
<td>
<%#Eval("Name") %>
</td>
<td>
<%#Eval("Time") %>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
</form>
</body>
</html>

效果展示:

aaarticlea/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vGFdI/7iAEnngVhPN07mky5mN/agYnp3lrN2R/SHaS78fJVt7gPF1A6TaLaq8UdWwabzD3d7x6XMDfdJ/aQdM+NdPe+B6dJ3McKuKTfvFLb3rHF84KxLih6qAuOjEtoHXJTKeddtLYi3RMg3f/8UDuDf7Uom5e/AhGNf969ttFf8NKsgoPjmtjDd+UQZKSHtWMa0WpkyFiBK90vMyyQ8rSjzO9Tk5Fh1lIfiKv2XzHVgkRsL/fqarUu1QrqHtYKdo9L6Bvyu74odfdQ9Nxs1TRkrKPh3D0u/ZIhf7uA6ZEFYfrcZLJjHzumO4BWTCIgFtIdgI1JBMRCugOwMYmAWFS6AwCAiKrp/gsAAMTEO0gBAMiGdAcAIBvSHQCAbEh3AACyId0BAMiGdAcAIBvSHQCAbEh3AACyId0BAMiGdAcAIBvSHQCAbEh3AACyId0BAMiGdAcAIJv/AKsOYih57xeJAAAAAElFTkSuQmCC" alt="" />

合并多个List<T>类型并通过LINQ按指定属性排序的更多相关文章

  1. 分析器错误消息: 类型“test.test.testx”不明确: 它可能来自程序集“F:\testProject\bin\test.test.DLL”或程序集“F:\testProject\bin \testProject.DLL”。请在类型名称中显式指定程序集。

    问题描述: RT 分析器错误消息: 类型“test.test.testx”不明确: 它可能来自程序集“F:\testProject\bin\test.test.DLL”或程序集“F:\testProj ...

  2. 与元素类型 "item" 相关联的 "name" 属性值不能包含 '<' 字符。

    Android Studio 打包时,报错: 与元素类型 "item" 相关联的 "name" 属性值不能包含 '<' 字符. 这个问题自己百度也没有发现 ...

  3. C# 核心语法-反射(反射类型、方法、构造函数、属性,实现可配置可扩展,完成数据库访问类反射封装)

    反射是.NET中的重要机制,通过反射,可以在运行时获得程序或程序集中每一个类型(包括类.结构.委托.接口和枚举等)的成员和成员的信息.有了反射,即可对每一个类型了如指掌.另外我还可以直接创建对象,即使 ...

  4. 类型“Observable<Response>”上不存在属性“map”

    出错提示: angular2 Property 'map' does not exist on type 'Observable<Response>' 类型“Observable<R ...

  5. C#—反射(反射类型、方法、构造函数、属性、实现可配置可扩展、数据库访问类反射封装)

    反射是.NET中的重要机制,通过反射,可以在运行时获得程序或程序集中每一个类型(包括类.结构.委托.接口和枚举等)的成员和成员的信息.有了反射,即可对每一个类型了如指掌.另外我还可以直接创建对象,即使 ...

  6. 合并多个cv::Mat类型,即合并多个图片的接口

    1. cv::Mat get_merage_image(cv::Mat cur_frame) { cv::Mat image_one=cur_frame; cv::Mat image_two=cur_ ...

  7. PAT 基础编程题 4-11 求自定类型元素序列的中位数(希尔排序)

    4-11 求自定类型元素序列的中位数   (25分) 本题要求实现一个函数,求N个集合元素A[]的中位数,即序列中第\lfloor N/2 +1\rfloor⌊N/2+1⌋大的元素.其中集合元素的类型 ...

  8. 1.4.2 solr字段类型--(1.4.2.7)字段属性使用案例

    1.4.2 solr字段类型 (1.4.2.1) 字段类型定义和字段类型属性. (1.4.2.2) solr附带的字段类型 (1.4.2.3) 使用货币和汇率 (1.4.2.4) 使用Dates(日期 ...

  9. JavaScript类型检测, typeof操作符与constructor属性的异同

    *#type.js function Person(name, age) { this.name = name; this.age = age; } var d = {an: 'object'}; v ...

随机推荐

  1. Jmeter监控系统等资源,ServerAgent端口的修改

    默认情况下在下载的ServerAgent下,如果服务是windows系统,则直接启动"startAgent.bat"即可,如果是Linux系统,则直接启动"./start ...

  2. linux内核设计与实现--从内核出发

    linux内核有两种版本:稳定的和处于开发中的. linux通过一种简单的命名机制来区分稳定的和处于开发中的内核,使用3个或者4个“.”分割的数字来代表不同内核版本. 如:2.6.26.1:第一个数字 ...

  3. Golang 图片上绘制文字

    之前介绍过使用 FreeType-go 来绘制字(http://www.cnblogs.com/ghj1976/p/3445568.html),  现在相关的包被做了整合,主要是整合到了 github ...

  4. Python第九章模块和包

    1.import Python文件的时候文件名不能跟Python中自带的关键字重复,否则无法使用关键字的方法. 2.Reload(),重载例子 import sysreload(sys)sys.set ...

  5. dwr NoSuchBeanDefinitionException

    使用SpringMVC spring  dwr时,dwr使用的bean,要将bean配置到根webapplicationcontext中,即applicationContext.xml中, 不能放到d ...

  6. Hbase基础操作

    $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter 'tablename'

  7. Redis附加功能之Redis流水线pipeline

    流水线功能的目的:通过减少客户端与服务器之间的通信次数来提高程序的执行效率. 一.通信 在一般情况下, 用户每执行一个 Redis 命令,客户端与服务器都需要进行一次通信:客户端会将命令请求发送给服务 ...

  8. 翻译:Knockout 快速上手 - 5: 你需要知道的顶级特性 续

    Utilities Knockout 提供了许多可以你开发中使用的工具,你可以在 ko.utils 命名空间中找到它们,我最喜欢的工具如下所示: extend: 这个方法将两个对象合并在一起,调用这个 ...

  9. python 简单实现文件拷贝

    1.背景 一日加班需要写一个文件拷贝的函数. 写了几版拷贝函数,有需要的直接粘贴过去 def CopyLocaleFile1(sorfile,desfile): #第一版 sorfp=open(sor ...

  10. leetcode reverse bits python

    Reverse Bits Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (re ...