官术网_书友最值得收藏!

Why use ASP.NET

Why should we choose ASP.NET? There are plenty of suitable programming languages and frameworks, including PHP, Ruby on Rails, Java, and even Classic ASP, which would work fine. Content Management Systems have been developed in pretty much every language and technology ever developed for computer systems, and you might even be more familiar with them than you are with ASP.NET.

ASP.NET, specifically ASP.NET 2.0, has some definite advantages for developing a Content Management System quickly and conveniently. A security system, complete with membership features, is already part of the framework, and so are standard design templates in the form of master pages. Easy configurations for database connections and controls for displaying the data are built in, and by using Visual Web Developer (or Visual Studio) we can take advantage of rapid development techniques to speed up our time to deploying a usable application.

ASP.NET 2.0, as well as the extensions to it (curiously named ASP.NET 3.0 and ASP.NET 3.5), is not a programming language, but a framework to develop applications within. ASP.NET is language independent. You can use any language that supports the ASP.NET framework, but for our application we will use Visual Basic .NET. Visual Basic is a simple, forgiving language that is easy to follow in code and has been used for hundreds of millions of lines of code in web applications around the world. If you feel comfortable translating VB to C#, please feel free to follow along in the language of your choice. Compiled application code resulting in Dynamic Link Libraries (DLLs) can be accessed by any language, meaning we could program in both VB and C# for separate parts of the application, but that would make this book harder to follow.

ASP.NET membership and profiles

ASP.NET 2.0 introduced membership and profiles to create users, assign security roles, and provide for authentication and validation of security credentials, all within the ASP.NET framework. This means developers don't have to build an authentication system for applications (unless they want to), and accounts can be protected by one-way hashed passwords, while allowing a simple assignment of access and authority to application pages.

Until the release of ASP.NET 2.0, developers were left to craft their own security system for their applications, including user management functions such as assigning and changing passwords. Add to it the functionality provided by roles in ASP.NET, and an entire security and authentication system for a site can be built with mouse clicks. User profiles are icing on the cake, allowing administrators and users to control their online profile, which can be easily integrated into an application.

ASP.NET Master Pages and Themes

ASP.NET 2.0 introduced the concepts of Master Pages and Themes to help in designing a consistent look and feel to the pages throughout a web application. Master Pages contain common elements, including menus, controls, and graphics, which are displayed on all pages. Content pages contain the individual content that changes on a web page, and are merged with the Master Page when ASP.NET renders the final HTML to the browser.

Master Pages contain ContentPlaceHolders where dynamic content is injected when the page is rendered. A browser requests the content page, which has a declaration for the Master Page, and ASP.NET places the content defined on the content page into appropriate content place holders on the Master Page. The result is that should you want to change the look and feel of your site, you change the Master Page once for your application without touching the content pages. This allows for very simple styling by designers without the need for them to touch the underlying code or having to edit any content to change the look.

ASP.NET 2.0 also introduced Themes, which can be used to alter the look of a site, including controls used on the site. Themes are a combination of control skins (.skin files), style sheets (CSS), and graphics that are applied as a group to a page, site, or even an entire server. Even more than with Master Pages, which require at least minimal ASP.NET programming to use, designers can create themes that can be used on a site to alter the look and feel, without touching any other files on the system.

ASP.NET 3.5

Microsoft has done the programming community a disservice in the numbering of ASP.NET versions. ASP.NET 1.0 was the first version released to the public, and was upgraded to a 1.1 version. The next release, ASP.NET 2.0, was an entirely new framework with many enhancements, including Master Pages and membership that are important to our application in this book. ASP.NET 2.0 also included data access and display controls, as well as navigation controls, which we will use.

ASP.NET 3.0 added the Windows Presentation Foundation (WPF) and Windows Communication Foundation (WCF), but used the same ASP.NET 2.0 framework to run these extensions. ASP.NET 3.5 added AJAX and LINQ, but still just extended the 2.0 framework. So, ASP.NET 3.5 is really ASP.NET 2.0 with "extra stuff" that makes the framework more usable, but it doesn't really change the framework. Microsoft would have been better off numbering these as ASP.NET 2.1 and 2.2 to avoid confusion in the community, but we're stuck with the confusing numbering for now. Microsoft does have some logic in changing its numbering, but it makes sense mostly to the marketing folks and not programmers.

For this book, we will use ASP.NET 3.5—partly because it's the most current and default version for Visual Web Developer 2008 and also because it adds some functionality that we'll be using later. LINQ (Language Integrated Query) provides a uniform query language to access any data source, treating the data as an object and making the application extremely extensible to third-party data sources. We'll use LINQ to SQL for a portion of our application.

ASP.NET 3.5 also provides some new data display options such as ListView and Datapager, and provides much better support for nested Master Pages than earlier versions. AJAX, included in ASP.NET 3.5, also allows for a richer user experience, though we won't be making use of it in our basic application.

主站蜘蛛池模板: 梨树县| 临泽县| 纳雍县| 泾川县| 南部县| 运城市| 雷州市| 建宁县| 玉山县| 安岳县| 永平县| 阿尔山市| 永兴县| 绍兴县| 阿克苏市| 含山县| 宁远县| 湖北省| 中山市| 贵德县| 新营市| 桐乡市| 建平县| 报价| 临夏市| 小金县| 清涧县| 越西县| 益阳市| 海安县| 彩票| 彝良县| 托克托县| 沧源| 新巴尔虎左旗| 鹰潭市| 古蔺县| 平陆县| 乐平市| 四会市| 腾冲县|