且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MVC在新视图中显示URL列表

更新时间:2023-11-29 22:24:16

简单的方法是返回带有排序列表的View.

您可以使用排序算法手动或使用SortedDictionary类System.Collection.Generic命名空间自动对返回视图的集合进行排序.

默认情况下,Herez转换后的代码按返回列表的排序列表:
Simple way is to return the View with the sorted list.

You can sort the collection of return view either manually using sort algorithm or automatically using SortedDictionary class System.Collection.Generic namespace.

Herez the converted code by default sorted list on return View:
using System.Collection.Generic;
....
....
{
   Sorteddictionary<string,> list - new SortedDictionary<string,string>();
   list = ExtractURL(content;
   return View(new Website(list, "Addresses"));
}


默认情况下,第一个字符串被视为Key并在每个元素的插入上自动排序.我们将找到所需的解决方案.


By default, the first string is treated as Key and sorted automatically on each elements'' insert. We''ll get the solution, what we are looking for.