随笔分类 - ASP.NET MVC
摘要:原文地址:http://www.cnblogs.com/xiaopin/archive/2010/08/31/1813747.html ASP.NET Global.ascx 事件大全 Global.asax 文件,有时候叫做 ASP.NET 应用程序文件,提供了一种在一个中心位置响应应用程序级或模块级事件的方法。你可以使用这个文件实现应用程序安全性以及其它一些任务。下面让我们详细看一下如何在...
阅读全文
摘要:原文地址:http://www.yesky.com/SoftChannel/72342380468043776/20030618/1708715.shtml 一 写入Cookie 1. Name 和 Value 属性由程序设定,默认值都是空引用。 2. Domain属性的默认值为当前URL的域名部分,不管发出这个cookie的页面在哪个目录下的。 例如,http://www...
阅读全文
摘要:ASP.NET MVC 4 Beta 发布 投递人 works guo发布于 2012-02-21 10:37评论(7)有1667人阅读 原文链接 [收藏] « » ASP.NET MVC 4 Beta 突出 ASP.NET Web API 功能。 新功能特性: (1) ASP.NET Web API (2) 添加移动项目模板 (3) 对移动 app 特性的功能支持,JQ...
阅读全文
摘要:新捆绑和缩小支持(ASP.NET 4.5系列)By DevDivChina[原文发表地址] New Bundling and Minification Support (ASP.NET 4.5 Series)[原文发表时间] 2011-11-27 20:58这是我的ASP.NET 4.5系列中的第六篇博文。下一个.NET和Visual Studio的发布包含很多新特性和功能。在ASP.NET 4.5中,你将会看到很多真的非常好的关于Web 窗体、MVC的改进,以及关于二者构建基础的ASP.NET核心基础的改进。今天的博文涵盖了我们在ASP.NET中为捆绑和缩小添加内置支持所做的一些工作,那些支
阅读全文
摘要:ASP.NET MVC的全球化方案http://www.chinaz.com/program/2010/1020/138710_2.shtml核心提示:由于项目需要最近在学习ASP.NET MVC。在实践中,网站要支持多语言,需要全球化。在MVC下我实现了一个全球化框架,在这里与各位分享一下,不足之处也请各位看官指教。由于项目需要最近在学习ASP.NET MVC。在实践中,网站要支持多语言,需要全球化。在MVC下我实现了一个全球化框架,在这里与各位分享一下,不足之处也请各位看官指教。让URL支持全球化经常上微软网站的朋友可能很熟悉类似包含..\zh-cn\..、..\en-us\..的url形
阅读全文
摘要:ASP.NET MVC使用T4http://developer.51cto.com/art/200907/138658.htm本文介绍ASP.NET MVC使用T4,一个T4模板结合了纯文本块和逻辑控制,看上去和其他Web Form页面十分接近,Abhishek Mishra给出了一个编辑模板的详细示例。AD:在项目里添加控制器和视图时,ASP.NET MVC使用T4(文本模板转换工具箱,Text Template Transformation Toolkit)来生成代码。T4是一个高度定制化的,基于模板的文本生成器。Scott Guthrie之前所宣布的ASP.NET MVC的功能之一就是使
阅读全文
摘要:原文:ASP.NET MVC生命周期介绍asp.net应用程序管道处理用户请求时特别强调"时机",对asp.net生命周期的了解多少直接影响我们写页面和控件的效率。对于asp.net mvc,我对它的生命周期兴趣很浓,于是对ASP.NET MVC生命周期提出两个问题:一个HTTP请求从IIS移交到asp.net运行时,asp.net mvc是在什么时机获得了控制权并对请求进行处理呢?处理过程又是怎样的?以IIS7中asp.net生命周期为例,上图是来自MSDN的一张HTTP请求处理过程发生事件的简图,后面我列出了一个完整的事件列表。既然asp.net mvc还是以asp.n
阅读全文
摘要:在开发中有时要在后台获得某个View 或者 PartialView 生成的字符串,只要你熟悉Asp.Net MVC 生命周期就能理解和敲出下面的代码。没什么高深的,直接上代码:1,输出ViewHTML字符串: ///<summary>///描述:输出ViewHTML字符串///</summary>///<paramname="controller"></param>///<paramname="viewName">视图文件名</param>///<paramname="
阅读全文
摘要:Implementing Edit, Details, and Delete ViewsOpen the Movie controller and add the following Details method:public ActionResult Details(int id) { Movie movie = db.Movies.Find(id); if(movie == null) return RedirectToAction("Index"); return View("Details", movie);}The code-first app
阅读全文
摘要:Adding a New Field to the Movie Model and TableIn this section you'll see how easy it is to evolve the schema of our database by simply adding another field to the Movie class. Open the Movie class and add a Rating property (column) that has a StringLength attribute applied to it:[StringLength(5
阅读全文
摘要:Adding Validation to the ModelIn this section we're going to implement the support necessary to enable input validation in the application. We'll ensure that database content is correct and provide helpful error messages to end users when they try to enter movie data that isn't valid. We
阅读全文
摘要:Adding a Create Method and Create View In this section we're going to implement the support necessary to enable users to create new movies in the database. We'll do this by creating a controller action method that we can call using /Movies/Create on the end of the URL.Implementing the code t
阅读全文
摘要:Accessing your Model's Data from a ControllerIn this section, you'll create a new MoviesController class and write code that retrieves the movie data and displays it in the browser using a view template. Right-click the Controllers folder and make a new MoviesController class.This creates a
阅读全文
摘要:Entity Framework Code-First DevelopmentThe Entity Framework version 4 supports a development paradigm called code-first. Code-first allows you to create model object by writing simple classes (also known as POCO, from "plain-old CLR objects") and have the database created on the fly from y
阅读全文
摘要:Adding a ViewIn this section we're going to modify the HelloWorldController class to use a view template file to cleanly encapsulate the process of generating HTML responses to a client.Let's start by using a view template with the Index method in the HelloWorldController class. Currently th
阅读全文
摘要:Adding a ControllerMVC stands for model-view-controller. MVC is a pattern for developing applications such that each part has a separate responsibilit...
阅读全文
摘要:This tutorial will teach you the basics of building an ASP.NET MVC Web application using Microsoft Visual Web Developer Express, which is a free version of Microsoft Visual Studio. Before you start, make sure you have the prerequisites listed above installed using the Web Platform Installer.You'
阅读全文