<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_Catcher In The Rye_分类_ASP.NET MVC</title><id>http://feed.cnblogs.com/blog/u/18870/category/275429/rss</id><updated>2012-05-29T05:32:15Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/category/275429.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/18870/category/275429/rss"/><entry><id>http://www.cnblogs.com/alby/archive/2011/09/21/xoohoo-init.html</id><title type="text">Xoohoo系列(二)：初始化配置、加载模块或后台服务</title><summary type="text">从开发的角度讲，Global.asax文件是基于ASP.NET 应用程序的入口，而Application_Start方法正是一切的开始。 链接：IIS 5.0 和 6.0 的 ASP.NET 应用程序生命周期概述 Xoohoo实现了一个XoohooApplication类，其继承自HttpApplication。而XoohooApplication类供Global.asax来继承。 XoohooApplication类的Application_Start方法会完成两大工作。 一、初始化配置 1、设置IoC/DI容器。我们知道，虽然MVC3提供了依赖注入的支持，但并没有一个严格意义...</summary><published>2011-09-21T06:42:00Z</published><updated>2011-09-21T06:42:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2011/09/21/xoohoo-init.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2011/09/21/xoohoo-init.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2011/09/21/xoohoo-summary.html</id><title type="text">Xoohoo系列(一)：概述</title><summary type="text">作为一个开发者，我们免不了要做很多重复的事情。我们不只在重复别人造轮子，也在重复自我浪费时间——我们应该有一种罪恶感。庆幸的是很多人在帮助我们尽可能的减少这种重复，他们提出或总结了很多的宝贵的思想，开发了很多的有用的开发辅助工具。比如设计模式、类库、O/RM，代码生成器，以及更具体的CMS(Content Management System)等等。设计模式让我们在设计思想得到一定程度的解放，在设计方向上给予指引。这就像乘法口诀表，不用我们算个简单的3721还需要掰手指头；类库如.Net的BCL(Base Class Library)、FCL(Framework Class Library)等，</summary><published>2011-09-21T03:42:00Z</published><updated>2011-09-21T03:42:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2011/09/21/xoohoo-summary.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2011/09/21/xoohoo-summary.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2011/03/30/aspdotnet-mvc-update-3.html</id><title type="text">ASP.NET MVC 3 RTM 更新(3)</title><summary type="text">五、SessionStateAttribute构造SessionStateAttribute对象时必须传入一个SessionStateBehavior枚举值，通过Attribute的Behavior属性可以获取该值。该Attribute只能用于引用类型(AttributeTargets.Class)，不允许重复使用(AllowMultiple=false),允许继承(Inherited=true)。六、MvcRouteHandlerMvcRouteHandler类增加了一个接受IControllerFactory接口实现类的对象作为参数传的构造方法，构造对象允许传入null值。而构造方法内部只</summary><published>2011-03-30T05:10:00Z</published><updated>2011-03-30T05:10:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2011/03/30/aspdotnet-mvc-update-3.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2011/03/30/aspdotnet-mvc-update-3.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2011/03/25/aspdotnet-mvc-update-2.html</id><title type="text">ASP.NET MVC 3 RTM 更新(2)</title><summary type="text">三、IResolver&lt;TService&gt;和SingleServiceResolver&lt;TService&gt;:IResolver&lt;TService&gt;、MultiServiceResolver&lt;TService&gt;:IResolver&lt;IEnumerable&lt;TService&gt;&gt;IResolver&lt;TService&gt;接口只有一个TService型的Current只读属性,返回相应类型的一个对象。这是一个有Lazy意味的轻量接口。一个简单的IResolver&lt;TService&gt;接口的实现类中，Current</summary><published>2011-03-25T07:16:00Z</published><updated>2011-03-25T07:16:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2011/03/25/aspdotnet-mvc-update-2.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2011/03/25/aspdotnet-mvc-update-2.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2011/03/25/aspdotnet-mvc-update-1.html</id><title type="text">ASP.NET MVC 3 RTM 更新(1)</title><summary type="text">一、路由(Routing)路由功能最初整合在ASP.NET MVC(以下简称MVC)中，后来被独立出来形成了System.Web.Routing 3.5程序集。ASP.NET 4已经把Routing功能已经转移到了System.Web 4 程序集下作为基础服务的一部分。在使用Routing功能时，您已不再需要在web.config中注册Module，因为UrlRoutingModule已经集成进ASP.NET 4中了，就像FormsAuthenticationModule等Module一样(C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config</summary><published>2011-03-25T05:23:00Z</published><updated>2011-03-25T05:23:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2011/03/25/aspdotnet-mvc-update-1.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2011/03/25/aspdotnet-mvc-update-1.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2010/12/15/1906485.html</id><title type="text">ASP.Net MVC探索之路 - 不想在多个Action上写同样的FitlerAttribute(下)</title><summary type="text">ASP.NET MVC 3.0 RC相较于2.0 RTM增加了10个左右的接口、类或枚举来增强Filter，并且为ControllerActionInvoker增加了2个构造函数来配合这一切。目前白皮书上只有寥寥几句提到这方面而已。</summary><published>2010-12-15T03:41:00Z</published><updated>2010-12-15T03:41:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2010/12/15/1906485.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2010/12/15/1906485.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2010/12/10/stringlengthrangeattribute.html</id><title type="text">ASP.Net MVC探索之路 - 增加字符串长度范围校验Attribute</title><summary type="text">DataAnnotations提供了RequiredAttribute进行null或Empty校验、StringLengthAttribute进行字符串长度校验，很奇怪怎么不提供一个StringLengthRangeAttribute校验。比如我们在校验输入时，可能需要密码在6-20这个范围内，这时候我们自己扩展一个ValidationAttribute就行了，很简单：[代码]使用举例：[代码]后记：.Net 4下，System.ComponentModel.DataAnnotations命名空间下的StringLengthAttribute增加了MinimumLength属性可供设置最小字符</summary><published>2010-12-10T07:03:00Z</published><updated>2010-12-10T07:03:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2010/12/10/stringlengthrangeattribute.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2010/12/10/stringlengthrangeattribute.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2010/12/10/compareattribute-in-asp-net-mvc.html</id><title type="text">ASP.Net MVC探索之路 - Model的比较验证</title><summary type="text">基于ASP.NET MVC 2.0的比较验证</summary><published>2010-12-10T06:00:00Z</published><updated>2010-12-10T06:00:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2010/12/10/compareattribute-in-asp-net-mvc.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2010/12/10/compareattribute-in-asp-net-mvc.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2010/12/09/1900900.html</id><title type="text">ASP.Net MVC探索之路 - 减少Html.RouteLink或Url.RouteUrl使用次数</title><summary type="text">本文没什么技术含量，正适合放在目前状况下的博客园首页。首先定义一条路由规则： [代码] 以前生成链接是这么做的： [代码] 现在改为这样了： [代码] 首先生成一个链接地址： &lt;a href="/Details/0"&gt;{1}&lt;/a&gt; 将“0”替换成“{0}”后就成了这样： &lt;a href="/Details/{0}"&gt;{1}&lt;/a&gt; 然后我们根据这个格式去生成新的链接地址即可。 简洁起见，以上代码没进行Model空校验、Url编码处理、Html编码处理、列表格式化等。 另，老赵以前专门做过关于Url生成性能的分析。</summary><published>2010-12-09T01:44:00Z</published><updated>2010-12-09T01:44:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2010/12/09/1900900.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2010/12/09/1900900.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2010/12/08/1900555.html</id><title type="text">ASP.Net MVC探索之路 - 不想在多个Action上写同样的FitlerAttribute(上)</title><summary type="text">(写完本文后，我去下载了ASP.NET MVC 3 RC，发现它对Filter的可控性方面进行了某些增强——不仅仅是针对全局Filter的 GlobalFilterCollection——所以在此特别说明一下本文目前主要针对的是ASP.NET MVC 2.0 RTM，当然大部分都适用于3.0)以AuthorizeAttribute这个Filter举例，一个Controller有若干个Action，包括登录的Action（如Login）。这时我们有两种方式来实现：1、重新实现一个IAuthorizationFilter,在里面判断如果是Login这个Action，就不进行验证。然后将这个Filt</summary><published>2010-12-08T10:47:00Z</published><updated>2010-12-08T10:47:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2010/12/08/1900555.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2010/12/08/1900555.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/alby/archive/2010/01/07/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework.html</id><title type="text">《ASP.NET MVC验证框架中关于属性标记的通用扩展方法》之继续扩展</title><summary type="text">首先需要对xVal有点熟悉： http://www.codeplex.com/xval 建议下载最新源码而不是编译版本 再看两篇文章： http://goneale.com/2009/03/04/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework/ 深山老林将之翻译为：《ASP.NET MVC验证框架中关于属性标记的通用扩展方法》 http://www.cnblogs.com/wlb/archive/2009/12/01/1614209.html 现在有个"比较验证"的需求，比如注册帐号时候，需要判断两</summary><published>2010-01-07T11:00:00Z</published><updated>2010-01-07T11:00:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2010/01/07/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2010/01/07/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework.html"/><content type="text">首先需要对xVal有点熟悉： http://www.codeplex.com/xval 建议下载最新源码而不是编译版本 再看两篇文章： http://goneale.com/2009/03/04/using-metadatatype-attribute-with-aspnet-mvc-xval-validation-framework/ 深山老林将之翻译为：《ASP.NET MVC验证框架中关于属性标记的通用扩展方法》 http://www.cnblogs.com/wlb/archive/2009/12/01/1614209.html 现在有个"比较验证"的需求，比如注册帐号时候，需要判断两</content></entry><entry><id>http://www.cnblogs.com/alby/archive/2009/11/20/oxite-initialize.html</id><title type="text">Oxite分析之初始化</title><summary type="text">change set:46759 download:http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx Web应用程序的初始化我觉得应该分两类，一类是系统级的初始化，另一类是应用程序级的初始化。两者也有交叉的部分，如将会谈到的Application_Start 和 Application_End ，正是利用其在系统级的特殊性来完成应用程序级的初始化工作。关于系统级的初始化，MSDN上有简要的描述：《ASP.Net应用程序生命周期概述》http://msdn.microsoft.com/zh-cn/librar</summary><published>2009-11-20T07:36:00Z</published><updated>2009-11-20T07:36:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2009/11/20/oxite-initialize.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2009/11/20/oxite-initialize.html"/><content type="text">change set:46759 download:http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx Web应用程序的初始化我觉得应该分两类，一类是系统级的初始化，另一类是应用程序级的初始化。两者也有交叉的部分，如将会谈到的Application_Start 和 Application_End ，正是利用其在系统级的特殊性来完成应用程序级的初始化工作。关于系统级的初始化，MSDN上有简要的描述：《ASP.Net应用程序生命周期概述》http://msdn.microsoft.com/zh-cn/librar</content></entry><entry><id>http://www.cnblogs.com/alby/archive/2009/11/18/oxite.html</id><title type="text">Oxite分析之结构浅析</title><summary type="text">change set:46759download:http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx约定： 1、为了消除歧义，整个Oxite项目在这里统称为Oxite解决方案；而Oxite解决方案下有一个Oxite项目。 2、Module称之为模块 一、从模块的角度浅析Oxite解决方案结构 Oxite解决方案从某种角度上可以看成是一系列模块(Module)的集合。 OxiteSite项目是一个站点程序项目。Oxite解决方案是一个应用了ASP.NET MVC 模式的解决方案，而OxiteSite项目就相当于</summary><published>2009-11-18T08:15:00Z</published><updated>2009-11-18T08:15:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2009/11/18/oxite.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2009/11/18/oxite.html"/><content type="text">change set:46759download:http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx约定： 1、为了消除歧义，整个Oxite项目在这里统称为Oxite解决方案；而Oxite解决方案下有一个Oxite项目。 2、Module称之为模块 一、从模块的角度浅析Oxite解决方案结构 Oxite解决方案从某种角度上可以看成是一系列模块(Module)的集合。 OxiteSite项目是一个站点程序项目。Oxite解决方案是一个应用了ASP.NET MVC 模式的解决方案，而OxiteSite项目就相当于</content></entry><entry><id>http://www.cnblogs.com/alby/archive/2009/09/11/oxite-skinning.html</id><title type="text">Oxite分析之Skinning</title><summary type="text">change set：42944 download ：http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx Oxite中可以非常方便的切换皮肤(Skinning),并且前台皮肤(Site Skin)和后台皮肤(Admin Skin)都可以切换。Oxite的皮肤包括三部分：CSS + images, scripts and views。注意这个views就是MVC中的View部分，这样就带来更大的灵活性。这里提一下，Skin的设置会影响到ViewEngine在什么位置搜索View文件。官方也有关于Skinning</summary><published>2009-09-11T09:14:00Z</published><updated>2009-09-11T09:14:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2009/09/11/oxite-skinning.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2009/09/11/oxite-skinning.html"/><content type="text">change set：42944 download ：http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx Oxite中可以非常方便的切换皮肤(Skinning),并且前台皮肤(Site Skin)和后台皮肤(Admin Skin)都可以切换。Oxite的皮肤包括三部分：CSS + images, scripts and views。注意这个views就是MVC中的View部分，这样就带来更大的灵活性。这里提一下，Skin的设置会影响到ViewEngine在什么位置搜索View文件。官方也有关于Skinning</content></entry><entry><id>http://www.cnblogs.com/alby/archive/2009/09/08/oxite-actionresult.html</id><title type="text">Oxite分析之自定义Action返回值</title><summary type="text">change set：42353 download ：http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx查看一些Module下的Controller就会发现，里面有一些“特别”的public方法。比如Oxite.Modules.Core.Controllers.SiteController下有一个方法：OxiteViewModel 具体是什么类型我们在这里不去深究，可以肯定的是它没有直接或间接继承自ActionResult类。而这个方法在这里不是一个普通的方法,而是一个“Action”——它的返回值不是一个A</summary><published>2009-09-08T04:04:00Z</published><updated>2009-09-08T04:04:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2009/09/08/oxite-actionresult.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2009/09/08/oxite-actionresult.html"/><content type="text">change set：42353 download ：http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx查看一些Module下的Controller就会发现，里面有一些“特别”的public方法。比如Oxite.Modules.Core.Controllers.SiteController下有一个方法：OxiteViewModel 具体是什么类型我们在这里不去深究，可以肯定的是它没有直接或间接继承自ActionResult类。而这个方法在这里不是一个普通的方法,而是一个“Action”——它的返回值不是一个A</content></entry><entry><id>http://www.cnblogs.com/alby/archive/2009/09/08/oxite-module.html</id><title type="text">Oxite分析之Module</title><summary type="text">约定：在Oxite中，对实现了IOxiteModule接口的类称之为Module或模块。 在某种角度上，可以将Oxite看成是由一个个Module构成的。Oxite项目Modules目录下的各个Module可以看做是系统模块,如 Oxite.Modules.Core.OxiteModule、Oxite.Modules.Membership.MembershipModule 等;而解决方案目录Modules下的各个Module可以看做是自定义Module，如Oxite.Blogs.BlogsModule、 Oxite.CMS.CMSModule。</summary><published>2009-09-07T16:16:00Z</published><updated>2009-09-07T16:16:00Z</updated><author><name>alby</name><uri>http://www.cnblogs.com/alby/</uri></author><link rel="alternate" href="http://www.cnblogs.com/alby/archive/2009/09/08/oxite-module.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/alby/archive/2009/09/08/oxite-module.html"/><content type="text">约定：在Oxite中，对实现了IOxiteModule接口的类称之为Module或模块。 在某种角度上，可以将Oxite看成是由一个个Module构成的。Oxite项目Modules目录下的各个Module可以看做是系统模块,如 Oxite.Modules.Core.OxiteModule、Oxite.Modules.Membership.MembershipModule 等;而解决方案目录Modules下的各个Module可以看做是自定义Module，如Oxite.Blogs.BlogsModule、 Oxite.CMS.CMSModule。</content></entry></feed>
