代码改变世界

随笔分类 -  Asp.net MVC about

[转]Turn your Razor helpers into reusable libraries

2010-11-11 09:10 by AnyKoro, 447 阅读, 收藏, 编辑
摘要: The first blog post I ever wrote was titled “Turning an ascx user control into a redistributable custom control”. It was almost exactly five years ago, and it still gets a lot of hits toda... 阅读全文

转 mvc3 webimages

2010-11-06 14:39 by AnyKoro, 343 阅读, 收藏, 编辑
摘要: 在System.Web.Helpers.DLL中提供一个类:WebImage通过她可以方便的进行图片处理,她提供了对图片的切割、翻转、旋转、加文字水印或图片水印等功能。创建Asp.net mvc3网站项目。在Controller中添加如下代码:[代码] 阅读全文

Partial Requests in ASP.NET MVC

2010-03-11 21:26 by AnyKoro, 641 阅读, 收藏, 编辑
摘要: In your ASP.NET MVC application, it can be tricky to combine multiple independent “widgets” on the same page. That’s because a WebForms-style hierarchy of independent controls clashe... 阅读全文

[转]asp.net mvc 获取IP方法的扩展

2010-03-08 00:29 by AnyKoro, 633 阅读, 收藏, 编辑
摘要: asp.net mvc 获取IP方法的扩展1.扩展方法必须在非泛型静态类中定义2.扩展方法必须是静态的3.不能在静态类中声明实例成员public static class PubMethod { public static string GetIP(this Controller ctrl) { string ip; if (ctrl.HttpContext.Request.ServerVaria... 阅读全文

[转]验证MS关于DateTime的JSON表示

2010-03-07 00:04 by AnyKoro, 588 阅读, 收藏, 编辑
摘要: JSON有一个非常大的遗憾,就是对于DateTime类型没有进行相关的标准表示,于是MS为了解决此类问题,在Asp.net Ajax的实现中用\Date(tickets)\来表示日期时间,为了和表示日期时间的和类似于表示日期时间的数据取个开来,在传递的JSON字符串中 就是这样表示的,如:var jsonString='{"name":"James","birthday":"\\\/Date(10... 阅读全文

Integrating Adobe Flex and .NET with ASP.NET MVC

2010-03-01 10:04 by AnyKoro, 978 阅读, 收藏, 编辑
摘要: There are a lot of tools out there to help you utilize .NET as a back-end for Flex applications. All of these solutions come with a heavy customization and implementation cost. I’ve used WebORB ... 阅读全文

向mvc controller传递json数组

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

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

2010-02-23 09:15 by AnyKoro, 484 阅读, 收藏, 编辑
摘要: 【原文地址】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, 798 阅读, 收藏, 编辑
摘要: 在ASP.NET MVC中,我们可以使用HandleErrorAttribute特性来具体指定如何处理Action抛出的异常.只要某个Action设置了HandleErrorAttribute特性,那么默认的,当这个Action抛出了异常时MVC将会显示Error视图,该视图位于~/Views/Shared目录下.  设置HandleError属性  可以通过设置下面这些属性来更改HandleEr... 阅读全文

Output caching in ASP.NET MVC application

2010-02-21 13:19 by AnyKoro, 627 阅读, 收藏, 编辑
摘要: 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, 1531 阅读, 收藏, 编辑
摘要: 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... 阅读全文

MVC JSON - JsonResult and jQuery

2010-02-21 09:22 by AnyKoro, 3046 阅读, 收藏, 编辑
摘要: The latest release of the MVC framework provides the JsonResult forController actions. I was surprised that I did not find a weatlh of examplesfor usage so I figured it shouldn't be too hard to get a ... 阅读全文
点击右上角即可分享
微信分享提示