随笔分类 - net framework
摘要:下载地址 http://download.csdn.net/user/suizhikuo:目录LINQ to SQL语句(1)之Where. 2Where操作... 21.简单形式:... 22.关系条件形式:... 23.First()形式:... 3LINQ to SQL语句(2)之Select/Distinct. 31.简单用法:... 42.匿名类型 形式:... 43.条件形式:... 54.指定类 型形式:... 65.筛选形式:... 66.shaped形式(整形类型):... 67.嵌套类型形式:... 78.本地方法调用 形式(LocalMethodCall):... 79.
阅读全文
摘要: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
阅读全文
摘要: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'
阅读全文
摘要:XMLHttpRequest 对象 XMLHttpRequest可以提供不重新加载页面的情况下更新网页,在页面一加载后在服务器端请求数据,在页面加载后在服务器端接受数据,在后台向服务器发送数据。 XMLHttpRequest 对象提供了对 HTTP 协议的完全的访问,包括做出 POST 和 HEAD 请求以及普通的 GET 请求的能力。XMLHttpRequest 可以同步或异步地返回 Web 服务器的响应,并且能够以文本或者一个 DOM 文档的形式返回内容。 尽管名为 XMLHttpRequest,它并不限于和 XML 文档一起使用:它可以接收任何形式的文本文档。 XMLHtt...
阅读全文
摘要:遍历Request.ServerVariables Request.ServerVariables("Url")返回服务器地址Request.ServerVariables("Path_Info")客户端提供的路径信息Request.ServerVariables("Appl_Physical_Path")与应用程序元数据库路径相应的物理路径Request.ServerVariables("Path_Translated")通过由虚拟至物理的映射后得到的路径Request.ServerVariables("
阅读全文