注冊 | 登錄讀書好,好讀書,讀好書!
讀書網(wǎng)-DuShu.com
當(dāng)前位置: 首頁出版圖書科學(xué)技術(shù)計算機/網(wǎng)絡(luò)軟件與程序設(shè)計網(wǎng)絡(luò)編程ASP.NET MVC 4開發(fā)指南

ASP.NET MVC 4開發(fā)指南

ASP.NET MVC 4開發(fā)指南

定 價:¥59.00

作 者: 黃保翕(Will保哥)
出版社: 清華大學(xué)出版社
叢編項:
標(biāo) 簽: ASP 程序設(shè)計 計算機/網(wǎng)絡(luò)

ISBN: 9787302324294 出版時間: 2013-07-01 包裝: 平裝
開本: 16 頁數(shù): 450 字?jǐn)?shù):  

內(nèi)容簡介

  本書是由臺灣知名博客站長與暢銷書作者“Will保哥”所撰寫的ASP.NET MVC 4開發(fā)指南,融入作者多年實務(wù)開發(fā)工作之精髓,從基礎(chǔ)觀念、技術(shù)講解、開發(fā)實例、開發(fā)技巧到安裝部署,都將以深入淺出的例子帶領(lǐng)讀者理解ASP.NET MVC框架的精妙之處,讓網(wǎng)站生成工作更加安全、快速,也更容易維護!本書共分11章,第1章講解通用的MVC特性,第2章講述正確的開發(fā)觀念,第3章以一個簡單的例子帶領(lǐng)讀者快速上手ASP.NET MVC,第4~8章分別介紹了ASP.NET MVC最重要的核心觀念與技術(shù)解析,其中包括路由與生命周期、模型、控制器、Razor視圖引擎技術(shù)、本地技術(shù)等,第9章則以更高級的方式完成一套完整的電子商務(wù)網(wǎng)站開發(fā)實例,第10章分享筆者多年累積的各種開發(fā)技巧,第11章詳述如何部署ASP.NET MVC到正式環(huán)境。本書適合有ASP.NET窗體開發(fā)經(jīng)驗的開發(fā)人員閱讀,書中的演示能清楚帶領(lǐng)讀者快速了解ASP.NET MVC的開發(fā)細(xì)節(jié)與觀念,相信能為讀者帶來全新的視野,輕松排查網(wǎng)站開發(fā)過程中衍生的各種難題。

作者簡介

  黃保翕(Will保哥) 網(wǎng)絡(luò)知名技術(shù)專家(個人博客The WillWill Web記載著Will在網(wǎng)絡(luò)世界的學(xué)習(xí)心得與技術(shù)分享)。當(dāng)前已經(jīng)超過千篇文章。 臺科大電子工程系畢業(yè),現(xiàn)任多奇數(shù)位創(chuàng)意有限公司技術(shù)總監(jiān),自身專攻Web開發(fā)已經(jīng)超過15年,早期專研LAMP相關(guān)技術(shù),近幾年全心轉(zhuǎn)移技術(shù)領(lǐng)域至Microsoft.NET Platform與ASP.NET開發(fā)技術(shù)。曾擔(dān)任 Visual Studio2010 上市發(fā)表會講師、MSDN講座講師、TechDays Taiwan 2010/2011 講師、TechEd China2011 講師,出版著作有《ASP.NETMVC 2 開發(fā)實戰(zhàn)》與《WindowsPhone開發(fā)實戰(zhàn)》等。擅長各式Web排查方案、中大型網(wǎng)站架構(gòu)規(guī)劃、數(shù)據(jù)庫系統(tǒng)設(shè)計、網(wǎng)站屬性管理系統(tǒng)、網(wǎng)絡(luò)系統(tǒng)與Web集成。微軟最有價值專家(MVP),擁有MCTS、MCPD等國際認(rèn)證。

圖書目錄

第1章  在學(xué)習(xí)ASP.NET MVC 之前··································· 3  1.1  何謂MVC······························· 3 1.1.1  何謂Model······················· 4 1.1.2  何謂View························· 5 1.1.3  何謂Controller················· 6 1.2  初探MVC架構(gòu)······················ 7 1.2.1  彼此的關(guān)聯(lián)性·················· 7 1.2.2  Controller與View 的關(guān)聯(lián)性·························· 7 1.2.3  View與Model 的關(guān)聯(lián)性·························· 8 1.2.4  Model與Controller 的關(guān)聯(lián)性·························· 9 1.3  彼此的獨立性························· 9 1.3.1  Controller與View之間  的獨立性·························· 9 1.3.2  View與Model之間  的獨立性·························· 9 1.3.3  Model與Controller之間  的獨立性·························· 10 1.4  為什么要ASP.NET MVC······ 10 1.4.1  關(guān)注點分離與可維護性·· 10 1.4.2  開放特性與社群支持······ 10 1.4.3  開發(fā)工具與效率·············· 13 1.4.4  易于測試的架構(gòu)·············· 13 1.4.5  易于分工的架構(gòu)·············· 14 1.5  總結(jié)········································· 14 第2章  創(chuàng)建正確的開發(fā)觀念·· 15  2.1  關(guān)注點分離····························· 15 2.2  以習(xí)慣替換配置····················· 16 2.2.1  Controller·························· 17 2.2.2  View·································· 18 2.2.3  Model································ 18 2.3  開發(fā)ASP.NET MVC項目時  的建議···································· 19 2.4  ASP.NET MVC常見問題······ 23 2.5  總結(jié)········································· 31 第3章  新手上路初體驗············ 33 3.1  認(rèn)識Visual Studio 2012 開發(fā)工具································ 33 3.2  介紹NuGet套件管理員········ 40 3.2.1  遭遇問題·························· 40 3.2.2  使用方法·························· 41 3.2.3  開啟程序包管理器 控制臺(Package Manager Console)··········· 43 3.2.4  啟用NuGet套件還原······ 45 3.3  創(chuàng)建第一個ASP.NET MVC 專案········································ 47 3.3.1  利用ASP.NET MVC 4 項目模板創(chuàng)建項目·········· 48 3.3.2  創(chuàng)建數(shù)據(jù)模型·················· 57 3.3.3  創(chuàng)建控制器、動作與 檢視·································· 59 3.3.4  測試當(dāng)前創(chuàng)建好的留言板 網(wǎng)頁·································· 62 3.3.5  查看數(shù)據(jù)庫屬性·············· 66 3.3.6  了解自動生成的程序 代碼·································· 67 3.3.7  調(diào)整前臺讓用戶留言 的版面······························ 85 3.4  學(xué)習(xí)MVC的注意事項·········· 91 3.4.1  了解不同的項目類型······ 91 3.4.2  初學(xué)者常犯的錯誤·········· 92 3.4.3  小心使用Request與Response 對象·································· 93 3.4.4  不要在檢視中撰寫過多 的程序邏輯···················· 93 3.5  總結(jié)····································· 93
第2篇  技術(shù)講解篇      
第4章  Routing與ASP.NET MVC 生命周期························· 99 4.1  Routing——網(wǎng)址路由············ 99 4.1.1  比對通過瀏覽器傳來的 HTTP要求······················· 99 4.1.2  響應(yīng)適當(dāng)?shù)木W(wǎng)址給 瀏覽器······························ 100 4.1.3  默認(rèn)網(wǎng)址路由屬性解說·· 101 4.2  HTTP要求的URL如何對應(yīng) 網(wǎng)址路由································· 104 4.2.1  網(wǎng)址路由演示·················· 104 4.2.2  替網(wǎng)址路由加上路由值 的條件約束······················ 106 4.3  網(wǎng)址路由如何在ASP.NET MVC中生成網(wǎng)址·················· 107 4.4  ASP.NET MVC的運行生命 周期········································· 113 4.4.1  網(wǎng)址路由比對·················· 113 4.4.2  運行Controller與Action· 115 4.4.3  運行View并回傳結(jié)果···· 120 4.5  總結(jié)········································· 120 第5章  Model相關(guān)技術(shù)············· 121 5.1  關(guān)于Model的責(zé)任················· 121 5.2  開發(fā)Model的基本觀念········· 122 5.2.1  何謂ORM························ 122 5.2.2  數(shù)據(jù)庫開發(fā)模式·············· 124 5.3  LocalDB介紹·························· 125 5.3.1  LocalDB 的運作方式······ 125 5.3.2  如何連接LocalDB實例·· 128 5.3.3  管理LocalDB自動實例·· 130 5.3.4  管理LocalDB具名實例·· 132 5.4  使用Code First創(chuàng)建數(shù)據(jù) 模型········································· 134 5.4.1  創(chuàng)建數(shù)據(jù)模型·················· 134 5.4.2  創(chuàng)建數(shù)據(jù)上下文類·········· 148 5.4.3  設(shè)計模型之間的關(guān)聯(lián)性·· 149 5.4.4  啟用延遲裝入特性·········· 154 5.5  使用Code First數(shù)據(jù)庫遷移·· 155 5.5.1  EF Code First如何記錄 版本·································· 157 5.5.2  啟用數(shù)據(jù)庫遷移·············· 159 5.5.3  運行數(shù)據(jù)庫遷移·············· 163 5.5.4  自定義數(shù)據(jù)庫遷移規(guī)則·· 167 5.5.5  自動數(shù)據(jù)庫遷移·············· 170 5.5.6  如何避免數(shù)據(jù)庫被自動 創(chuàng)建或自動遷移·············· 171 5.6  使用ViewModel數(shù)據(jù)檢視 模型········································ 172 5.7  擴充數(shù)據(jù)模型························· 172 5.7.1  定義數(shù)據(jù)模型的 Metadata···························· 173 5.7.2  自定義Metadata驗證 屬性·································· 178 5.7.3  ASP.NET MVC 3新增的 驗證屬性·························· 179 5.7.4  Entity Framework新增 的驗證屬性······················ 179 5.7.5  .NET 4.5新增的驗證 屬性·································· 180 5.8  總結(jié)········································· 180   第6章  Controller相關(guān)技術(shù)····· 181 6.1  關(guān)于Controller的責(zé)任··········· 181 6.2  Controller的類別與方法········ 181 6.3  Controller的運行過程············ 182 6.3.1  找不到Action時的 處理方式·························· 183 6.3.2  動作名稱選定器·············· 185 6.4  動作方法選定器····················· 186 6.4.1  NonAction屬性················ 186 6.4.2  HTTP動詞限定屬性······· 187 6.5  ActionResult解說··················· 188 6.5.1  ViewResult························ 189 6.5.2  PartialViewResult·············· 193 6.5.3  EmptyResult······················ 193 6.5.4  ContentResult···················· 193 6.5.5  FileResult·························· 194 6.5.6  JavaScriptResult················ 198 6.5.7  JsonResult························· 199 6.5.8  RedirectResult··················· 201 6.5.9  RedirectToRoute················ 202 6.5.10  HttpStatusCodeResult····· 204 6.5.11  HttpNotFoundResult······· 205 6.5.12  HttpUnauthorizedResult·· 205 6.6  ViewData、ViewBag與      TempData概述························ 206 6.6.1  ViewData··························· 206 6.6.2  ViewData.Model··············· 207 6.6.3  ViewBag···························· 209 6.6.4  TempData·························· 210 6.7  模型綁定································· 212 6.7.1  簡單模型綁定·················· 212 6.7.2  使用FormCollection取得 窗體信息·························· 214 6.7.3  復(fù)雜模型綁定·················· 214 6.7.4  多個復(fù)雜模型綁定·········· 217 6.7.5  判斷模型綁定的驗證 結(jié)果·································· 220   6.7.6  模型綁定驗證失敗的錯誤 詳細(xì)信息·························· 222 6.7.7  清空模型綁定狀態(tài)·········· 223 6.7.8  使用Bind屬性限制可被 更新的數(shù)據(jù)模型屬性······ 224 6.7.9  使用UpdateModel與 TryUpdateModel··············· 226 6.8  動作過濾器····························· 228 6.8.1  授權(quán)過濾器屬性·············· 230 6.8.2  動作過濾器屬性·············· 234 6.8.3  結(jié)果過濾器屬性·············· 238 6.8.4  例外過濾器屬性·············· 239 6.8.5  自定義動作過濾器屬性·· 242 6.9  總結(jié)········································· 244 第7章  View數(shù)據(jù)呈現(xiàn)相關(guān) 技術(shù)··································· 245 7.1  關(guān)于View的責(zé)任··················· 245 7.2  了解Razor語法······················ 245 7.2.1  Razor基本語法················ 246 7.2.2  Razor與HTML混合 輸出·································· 247 7.2.3  Razor與HTML混合輸出 陷阱與技巧······················ 251 7.2.4  Razor與ASPX語法比較····· 255 7.2.5  Razor的主版頁面框架···· 258 7.2.6  @helper輔助方法············ 262 7.2.7  @functions自定義函數(shù)··· 266 7.2.8  @model引用參考資料 型別·································· 267 7.2.9  @using引用命名空間····· 267 7.3  View如何從Action取得 數(shù)據(jù)········································ 268 7.3.1  使用弱型別模型取得 數(shù)據(jù)·································· 269 7.3.2  使用強型別模型取得 數(shù)據(jù)·································· 271 7.4  HTML輔助方法····················· 271 7.4.1  使用HTML輔助方法輸出 超鏈接····

本目錄推薦

掃描二維碼
Copyright ? 讀書網(wǎng) m.ranfinancial.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號 鄂公網(wǎng)安備 42010302001612號