ASP.NET 概觀ASP.NET overview

ASP.NET 是免費的 web 架構來建置絕佳的網站和使用 HTML、 CSS 和 JavaScript 的 web 應用程式。ASP.NET is a free web framework for building great websites and web applications using HTML, CSS, and JavaScript. 您也可以建立 Web Api,並使用 Web 通訊端等即時技術。You can also create Web APIs and use real-time technologies like Web Sockets.

ASP.NET Core是 ASP.NET 的替代方式。ASP.NET Core is an alternative to ASP.NET. 請參閱如何在 ASP.NET 和 ASP.NET Core 之間進行選擇指引See the guidance on how to choose between ASP.NET and ASP.NET Core.

開始使用Get started

安裝Visual Studio 2017 Community edition 免費的 IDE,適用於在 Windows 上的 ASP.NET。Install Visual Studio 2017 Community edition, a free IDE for ASP.NET on Windows.

網站和 web 應用程式Websites and web applications

ASP.NET 提供三種建立 web 應用程式的架構:Web Form、 ASP.NET MVC 和 ASP.NET Web Pages。ASP.NET offers three frameworks for creating web applications: Web Forms, ASP.NET MVC, and ASP.NET Web Pages. 所有的三個架構穩定且成熟的而且您可以使用任何一個來建立絕佳的 web 應用程式。All three frameworks are stable and mature, and you can create great web applications with any of them. 無論您選擇何種架構,您會收到所有的優點和功能 ASP.NET 無所不在。No matter what framework you choose, you will get all the benefits and features of ASP.NET everywhere.

每個架構為目標的不同的開發樣式。Each framework targets a different development style. 其中您選擇取決於您程式設計的資產 (知識、 技能和開發體驗) 的組合,您要建立的應用程式和您已經熟悉的開發方法的類型。The one you choose depends on a combination of your programming assets (knowledge, skills, and development experience), the type of application you're creating, and the development approach you're comfortable with.

以下是每個架構和如何在它們之間做出選擇的一些概念的概觀。Below is an overview of each of the frameworks and some ideas for how to choose between them. 如果您偏好影片介紹,請參閱進行 ASP.NET 網站Web 工具是什麼?If you prefer a video introduction, see Making Websites with ASP.NET and What is Web Tools?

如果您在體驗If you have experience in 開發樣式Development style 專業知識Expertise
Web FormWeb Forms Win Form、 WPF、.NETWin Forms, WPF, .NET 快速開發使用豐富的程式庫的封裝的 HTML 標記的控制項Rapid development using a rich library of controls that encapsulate HTML markup 中級、 進階的 RADMid-Level, Advanced RAD
MVCMVC Ruby on Rails,.NETRuby on Rails, .NET 完整控制 HTML 標記、 程式碼和標記分隔,且容易撰寫測試的詳細資訊。Full control over HTML markup, code and markup separated, and easy to write tests. 行動和單一頁面應用程式 (SPA) 是最佳選擇。The best choice for mobile and single-page applications (SPA). 中級、 進階Mid-Level, Advanced
Web PagesWeb Pages 傳統 ASP、 PHPClassic ASP, PHP HTML 標記和您的程式碼一起在相同的檔案HTML markup and your code together in the same file 新的、 中間層級New, Mid-Level

Web FormWeb Forms

您可以使用 ASP.NET Web Form,建置動態網站,使用熟悉的拖放、 事件驅動模型。With ASP.NET Web Forms, you can build dynamic websites using a familiar drag-and-drop, event-driven model. 在設計介面及數以百計的控制項和元件,可讓您快速建置複雜且功能強大 UI 導向網站的資料存取。A design surface and hundreds of controls and components let you rapidly build sophisticated, powerful UI-driven sites with data access.

深入了解 Web FormLearn more about Web Forms

MVCMVC

ASP.NET MVC 可讓您建置動態網站,可讓清楚分離關注點,並讓您完全掌控標記,進而順暢、 敏捷式軟體開發開發功能強大、 以模式為基礎的方法。ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup for enjoyable, agile development. ASP.NET MVC 包含許多功能可讓您建立使用最新的 web 標準的精密應用程式的快速、 tdd 的開發。ASP.NET MVC includes many features that enable fast, TDD-friendly development for creating sophisticated applications that use the latest web standards.

深入了解 MVCLearn more about MVC

ASP.NET Web PagesASP.NET Web Pages

ASP.NET Web Pages 和 Razor 語法提供快速、 容易使用且輕量方式結合伺服器程式碼與 HTML,以建立動態 web 內容。ASP.NET Web Pages and the Razor syntax provide a fast, approachable, and lightweight way to combine server code with HTML to create dynamic web content. 連接到資料庫、 新增影片、 連結至社交網路網站,和包含許多更多的功能,可協助您建立美觀的網站符合最新的 web 標準。Connect to databases, add video, link to social networking sites, and include many more features that help you create beautiful sites that conform to the latest web standards.

深入了解網頁Learn more about Web Pages

Web Form、 MVC 和 Web 網頁的相關注意事項Notes about Web Forms, MVC, and Web Pages

所有的三種 ASP.NET 架構以.NET Framework 為基礎,並共用.NET 和 ASP.NET 的核心功能。All three ASP.NET frameworks are based on the .NET Framework and share core functionality of .NET and of ASP.NET. 比方說,所有的三個架構提供成員資格以基礎的登入安全性模型,並全部三種共用屬於 ASP.NET Core功能相同的設施管理要求、 處理工作階段,等等。For example, all three frameworks offer a login security model based around membership, and all three share the same facilities for managing requests, handling sessions, and so on that are part of the core ASP.NET functionality.

此外,這三種架構不是完全獨立,並選擇其中一個不會防止使用另一個。In addition, the three frameworks are not entirely independent, and choosing one does not preclude using another. 由於架構可以共存於相同的 web 應用程式,並不常見的使用不同的架構所撰寫的應用程式的個別元件。Since the frameworks can coexist in the same web application, it's not uncommon to see individual components of applications written using different frameworks. 比方說,MVC 最佳化標記,而若要利用資料控制項和簡單資料存取的 Web Form 開發的資料存取和管理的部分可能會進行開發的應用程式的客戶使用的部分。For example, customer-facing portions of an app might be developed in MVC to optimize the markup, while the data access and administrative portions are developed in Web Forms to take advantage of data controls and simple data access.

Web APIWeb APIs

ASP.NET Web API 是一種架構,可讓您更輕鬆建置 HTTP 服務並擴及各種用戶端,包括瀏覽器和行動裝置。ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web 應用程式開發介面是在 .NET Framework 上建置 RESTful 應用程式的理想平台。ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.

深入了解 Web APILearn more about Web API

即時技術Real-time technologies

ASP.NET SignalR 是 ASP.NET 開發人員更輕鬆開發即時 web 功能的新程式庫。ASP.NET SignalR is a new library for ASP.NET developers that makes developing real-time web functionality easier. SignalR 可讓伺服器和用戶端之間的雙向通訊。SignalR allows bi-directional communication between server and client. 伺服器可以將內容推至連線的用戶端立即可供使用。Servers can push content to connected clients instantly as it becomes available. SignalR 支援 Web 通訊端,並會回復為舊版瀏覽器其他相容的技術。SignalR supports Web Sockets, and falls back to other compatible techniques for older browsers. SignalR 連線管理包含 Api (例如,連接和中斷連接事件),分組連線及授權。SignalR includes APIs for connection management (for instance, connect and disconnect events), grouping connections, and authorization.

深入了解 SignalRLearn more about SignalR

行動裝置應用程式和網站Mobile apps and sites

ASP.NET 能夠與 Web API 後端,以及使用回應式設計架構,像是 Twitter Bootstrap 的行動 web 站台的原生行動應用程式。ASP.NET can power native mobile apps with a Web API back end, as well as mobile web sites using responsive design frameworks like Twitter Bootstrap. 如果您要建置原生的行動裝置應用程式,很容易建立 JSON 型 Web API 來控制代碼的資料存取、 驗證及您的應用程式的推播通知。If you are building a native mobile app, it's easy to create a JSON-based Web API to handle data access, authentication, and push notifications for your app. 如果您要建置回應靈敏的行動裝置網站,您可以使用任何的 CSS 架構或您想要的話,或選取功能強大的行動系統,例如 jQuery Mobile 或 Sencha 和 PhoneGap 絕佳行動應用程式的開啟方格系統。If you are building a responsive mobile site, you can use any CSS framework or open grid system you prefer, or select a powerful mobile system like jQuery Mobile or Sencha and great mobile applications with PhoneGap.

深入了解行動裝置應用程式和站台的開發Learn more about mobile app and site development

單一頁面應用程式Single-page applications

ASP.NET 單一頁面應用程式 (SPA) 可協助您建置包含大量使用 HTML 5、 CSS 3 和 JavaScript 的用戶端互動的應用程式。ASP.NET Single Page Application (SPA) helps you build applications that include significant client-side interactions using HTML 5, CSS 3 and JavaScript. Visual Studio 包含建置使用 knockout.js 和 ASP.NET Web API 的單一頁面應用程式的範本。Visual Studio includes a template for building single page applications using knockout.js and ASP.NET Web API. 除了內建的 SPA 範本中,社群建立 SPA 範本是可供下載。In addition to the built-in SPA template, community-created SPA templates are also available for download.

深入了解單一頁面應用程式開發Learn more about single-page app development

WebHookWebHooks

Webhook 是一起接線 Web Api 和 SaaS 服務提供簡單 pub/sub 模型的輕量型 HTTP 模式。WebHooks is a lightweight HTTP pattern providing a simple pub/sub model for wiring together Web APIs and SaaS services. 當事件發生在服務中時,會傳送通知的 HTTP POST 要求表單中已註冊的訂閱者。When an event happens in a service, a notification is sent in the form of an HTTP POST request to registered subscribers. POST 要求包含可讓收件者要據此採取行動之事件的相關資訊。The POST request contains information about the event which makes it possible for the receiver to act accordingly.

Webhook 會公開大量包括 Dropbox、 GitHub、 Instagram、 MailChimp、 PayPal、 Slack、 Trello 和更多的服務。WebHooks are exposed by a large number of services including Dropbox, GitHub, Instagram, MailChimp, PayPal, Slack, Trello, and many more. 比方說,WebHook 可以表示檔案已在 Dropbox 中,變更或已在 GitHub 中,認可程式碼變更或付款已起始 PayPal、 中或卡片在 Trello 中建立。For example, a WebHook can indicate that a file has changed in Dropbox, or a code change has been committed in GitHub, or a payment has been initiated in PayPal, or a card has been created in Trello.

深入了解 WebhookLearn more about WebHooks