代码改变世界

LINQ: difference between Single(), First(), and Take(1)

2010-02-27 14:04 by AnyKoro, 686 阅读, 0 推荐, 收藏, 编辑
摘要:LINQ provides a few different methods that return you a single object: Single(), First(), and Take(1).It took me a while, but I think I understand the difference: Single() operates on a collection of... 阅读全文

【转】LINQ的基本查询操作符

2010-02-27 13:57 by AnyKoro, 456 阅读, 0 推荐, 收藏, 编辑
摘要:•Distinct - 过滤集合中的相同项;延迟 •Union - 连接不同集合,自动过滤相同项;延迟 •Concat - 连接不同集合,不会自动过滤相同项;延迟 •Intersect - 获取不同集合的相同项(交集);延迟 •Except - 从某集合中删除其与另一个集合中相同的项;延迟 •Skip - 跳过集合的前n个元素;... 阅读全文

向mvc controller传递json数组

2010-02-27 00:11 by AnyKoro, 7243 阅读, 1 推荐, 收藏, 编辑
摘要:对于这个主题我没有找到最合适的办法,只是找出了个可以暂时规避问题的方法。发到这里非常希望各位大侠,能给小弟些思路解决此问题。一开始的需求本想实现这么一个功能这里的后台的程序这个是我最一开始的程序,刚一开始,发现整个程序怎么也不起作用(可以传到后台),一顿调试,发现时没有把json数据字符串化,后来使用了jqueryToJSON进行了字符串化,字符串化后,limit可以认出了,但是对于数组格式的li... 阅读全文

Jquery的属性选择器

2010-02-25 19:53 by AnyKoro, 204 阅读, 0 推荐, 收藏, 编辑
摘要:Attribute Filters:Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the '@' symbol from your selectors in order to make them work ... 阅读全文

SQL 2008 - Change ‘Edit Top 200 Rows"

2010-02-24 21:37 by AnyKoro, 572 阅读, 0 推荐, 收藏, 编辑
摘要:SQL 2008 - Change ‘Edit Top 200 Rows"Well this is a great idea from Microsoft, but what if you want them all, or you want more then 200 rows like me, I am greedy, I like everything….Any w... 阅读全文

ASP.NET MVC 2博客系列之一:强类型HTML辅助方法

2010-02-23 09:15 by AnyKoro, 481 阅读, 0 推荐, 收藏, 编辑
摘要:【原文地址】ASP.NET MVC 2: Strongly Typed Html Helpers 【原文发表日期】 Sunday, January 10, 2010 8:57 PM 【除了写博客外,我现在还使用Twitter发短贴和共享链接。请通过twitter.com/scottgu跟随我。】 这是我针对即将发布的ASP.NET MVC 2所撰写的贴子系列的第一篇,这个博客贴子将讨论 ASP.N... 阅读全文

【转】ASP.net MVC自定义错误处理页面的方法

2010-02-22 08:43 by AnyKoro, 793 阅读, 0 推荐, 收藏, 编辑
摘要:在ASP.NET MVC中,我们可以使用HandleErrorAttribute特性来具体指定如何处理Action抛出的异常.只要某个Action设置了HandleErrorAttribute特性,那么默认的,当这个Action抛出了异常时MVC将会显示Error视图,该视图位于~/Views/Shared目录下.  设置HandleError属性  可以通过设置下面这些属性来更改HandleEr... 阅读全文

【转】常用正则表达式

2010-02-22 08:11 by AnyKoro, 214 阅读, 0 推荐, 收藏, 编辑
摘要:正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常用的表达式收集于此,以备不时之需。匹配中文字符的正则表达式: [\u4e00-\u9fa5]评注:匹配中文还真是个头疼的事,有了这个表达式就好办了匹配双字节字符(包括汉字在内):[^\x00-\xff]评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)匹配空白行的正则表达式:\n\s*\r评注:可以用来删除空白行匹配HTML标记的正则表达式:<(\S*?)[^>]*>.*?</\1>|<.*? />评注:网上流传的版本太糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套 阅读全文

Output caching in ASP.NET MVC application

2010-02-21 13:19 by AnyKoro, 625 阅读, 0 推荐, 收藏, 编辑
摘要:Goal: Here, I am going to explain, how we can improve performance of ASP.Net MVC application using output caching. Advantage:It enables us to cache the content returned by Controller action.It stops c... 阅读全文

Sortable List using ASP.net MVC and jQuery

2010-02-21 10:28 by AnyKoro, 1526 阅读, 0 推荐, 收藏, 编辑
摘要:Sorting is one of the most basic and essential algorithm form the early days of computation, In this article we will be discussing about sorting a list of items in a web application, this is one of th... 阅读全文
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页