随笔分类 -  ASP.NET MVC

ASP.NET MVC。
ASP.NET MVC:Cookie 的过期时间在服务器端是获取不到的
摘要:现状一旦 Cookie 在服务器端设置后,在后续的请求中是获取不到过期时间的,因为:Cookie 是存储和过期处理都是由客户端管理的,在后续的请求中,浏览器向服务器发送 Cookie 的时候就不包含过期时间了。如何解决?将过期时间作为 Cookie 值一起存储到起来就可以解决这个问题了。 阅读全文

posted @ 2014-03-26 16:19 幸福框架 阅读(3343) 评论(0) 推荐(0) 编辑

ASP.NET MVC:mvc pattern
摘要:There are three pieces to the MVC pattern:The model—The domain that your software is built around. If you were buildinga blog, your models might be post and comment. In some contexts, the term modelmight refer to a view-specific model—a representation of the domain for thespecific purpose of being d 阅读全文

posted @ 2014-03-19 08:16 幸福框架 阅读(476) 评论(0) 推荐(0) 编辑

ASP.NET MVC:some benefits of asp.net mvc
摘要:Full control over HTMLFull control over URLsBetter separation of concernsExtensibilityTestability 阅读全文

posted @ 2014-03-18 08:10 幸福框架 阅读(150) 评论(0) 推荐(0) 编辑

ASP.NET MVC:@helper 不能调试
摘要:ASP.NET MVC 的 @helper 不能设置断点,当然我们可以将逻辑移动到扩展方法中,这里介绍另外一种方式,使用:System.Diagnostics.Debug.WriteLine,编程旅途以来,很少使用这个方法,这里记下来,希望下次遇到类似的场景,能立即想到她。 阅读全文

posted @ 2014-03-04 18:55 幸福框架 阅读(565) 评论(0) 推荐(0) 编辑

ASP.NET MVC:模块化/插件式文章汇总
摘要:方案Shazwazza | Developing a plugin framework in ASP.NET MVC with medium trust基于ASP.NET MVC3 Razor的模块化/插件式架构实现 - Mainz - 博客园知识Three Hidden Extensibility Gems in ASP.NET 4 - You've Been HaackedShandem / UmbracoV5 / source / Source / Libraries / Umbraco.Cms.Web / System / PluginManager.cs — Bitbucke 阅读全文

posted @ 2014-02-17 13:10 幸福框架 阅读(1229) 评论(0) 推荐(0) 编辑

ASP.NET MVC:模块化/插件式架构实现(转载)
摘要:I’ve recently spent quite a lot of time researching and prototyping different ways to create a plugin engine in ASP.NET MVC3 and primarily finding a nice way to load plugins (DLLs) in from outside of the ‘bin’ folder. Although this post focuses on MVC3, I am sure that the same principles will apply 阅读全文

posted @ 2014-02-16 13:04 幸福框架 阅读(2382) 评论(0) 推荐(0) 编辑

ASP.NET MVC:三个被隐藏的扩展性“钻石”(转载)
摘要:原文地址:http://haacked.com/archive/2010/05/16/three-hidden-extensibility-gems-in-asp-net-4.aspx/。ASP.NET 4 introduces a few new extensibility APIs that live the hermit lifestyle away from the public eye. They’re not exactlyhidden -they are well documented on MSDN - but they aren’t well publicized. It’s 阅读全文

posted @ 2014-02-15 12:58 幸福框架 阅读(449) 评论(0) 推荐(0) 编辑

ASP.NET MVC:如何提供 Controller 继承体系使用的 ModelBinder?
摘要:背景Mvc 提供了一种可扩展的模型绑定机制,具体来说就是:将客户端传递的参数按照一定的策略绑定到 action 的参数上,这带来的直接好处就是让 action 的参数支持强类型。一般来说我们有如下方式使用模型的绑定特性:按照约定。自定义一个 IModelBinder,然后将其应用到需要的参数上。自定义一个 IModelBinder,然后将其应用到指定的 Controller 上(不支持继承)。自定义一个 IModelBinder,然后将其注册到ModelBinders.Binders 中(影响全局)。自定义一个 IModelBinder,然后将其注册到 ModelBinders.Binders 阅读全文

posted @ 2014-01-20 13:44 幸福框架 阅读(1353) 评论(0) 推荐(0) 编辑

ASP.NET MVC:看 MVC 源码,学习:如何将 Area 中的 Controller 放到独立的程序集?
摘要:背景本文假设您已经熟悉了 ASP.NET MVC 的常规开发方式、执行模型和关键扩展点,这里主要说一下如何使用 ASP.NET MVC 的源代码解决一些问题。如何将 Area 中的 Controller 放到独立的程序集?为了更好的组合代码,我们都会使用 Area 划分我们的项目,也会把 Controller 移动到独立的程序集,多数情况这回导致问题。项目结构问题出现在哪里了?初步原因分析是 DefaultController 的 Namespace 不匹配 TestAreaRegistration 的 Namespace,我们把DefaultController 的 Namespace 修改 阅读全文

posted @ 2013-09-29 09:47 幸福框架 阅读(2668) 评论(4) 推荐(0) 编辑

ASP.NET MVC:会导致锁定的会话
摘要:背景一直没有意识到会话的访问会导致会话锁定,现在想想这样设计是非常合理的,不过某些情况下这样会导致同一个会话的并发访问非常低(只能串行化),好在MS提供了机制让我们控制这种锁。测试A页面:缓存写入页面1 public partial class Session_Lock_Test : System.Web.UI.Page2 {3 protected void Page_Load(object sender, EventArgs e)4 {5 this.Session["Data"] = DateTime.Now;6 7 ... 阅读全文

posted @ 2013-08-14 08:39 幸福框架 阅读(3216) 评论(6) 推荐(4) 编辑

ASP.NET MVC:多语言的三种技术处理策略
摘要:背景本文介绍了多语言的三种技术处理策略,每种策略对应一种场景,这三种场景是:多语言资源信息只被.NET使用。多语言资源信息只被Javascript使用。多语言资源信息同时被.NET和Javascript使用。下文我们就一个一个场景的分析。第一种场景:多语言资源信息只被.NET使用这种场景的技术处理最简单,可以充分利用VisualStudio提供的资源编辑器及资源文件。实现步骤1、定义资源文件。2、使用资源文件。1 Classic:@Strings.Title 第二种场景:多语言资源信息只被Javascript使用这种场景的技术实现需要参考使用的Javascript类库,自己做也不难(无非是原型 阅读全文

posted @ 2013-08-01 08:22 幸福框架 阅读(11027) 评论(6) 推荐(4) 编辑

ASP.NET MVC:多模板支持
摘要:背景准备写个博客练习一下WEB编程,有一个需求就是多模板支持,类似博客园的自定义模板一样,在ASP.NET MVC中如何处理这个需求呢?需求描述允许自定义模板,比如:传统模板、Metro模板等模板结构实现思路1重写模板引擎的默认搜索路径 1 private void SetTemplate(string template) 2 { 3 var razorViewEngine = ViewEngines.Engines.First(x => x is RazorViewEngine) as RazorViewEngine; 4 5 ... 阅读全文

posted @ 2013-07-30 08:54 幸福框架 阅读(10457) 评论(25) 推荐(10) 编辑

ASP.NET MVC:利用ASP.NET MVC4的IBundleTransform集成LESS
摘要:背景LESS确实不错,只是每次写完LESS都要手工编译一下有点麻烦(VS插件一直没有安装好),昨天在官方看到了如何用IBundleTransform集成LESS,今天就记录一下。参考资料:http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification。代码LessTransform 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 6 using System.Web.Optimizati. 阅读全文

posted @ 2013-07-26 08:37 幸福框架 阅读(3263) 评论(3) 推荐(2) 编辑

导航

我要啦免费统计