Wei-Meng Lee - C# 2008 Programmer's Reference

Здесь есть возможность читать онлайн «Wei-Meng Lee - C# 2008 Programmer's Reference» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Indianapolis, Год выпуска: 2009, ISBN: 2009, Издательство: Wiley Publishing, Inc., Жанр: Программирование, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

C# 2008 Programmer's Reference: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «C# 2008 Programmer's Reference»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

C# 2008 Programmers Reference provides a concise and thorough reference on all aspects of the language. Each chapter contains detailed code samples that provide a quick and easy way to understand the key concepts covered.

C# 2008 Programmer's Reference — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «C# 2008 Programmer's Reference», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

The source of the LinqDataSourcecontrol now looks like this:

ID="LinqDataSource1"

runat="server"

ContextTypeName="DataClassesDataContext"

EnableDelete="True"

EnableInsert="True"

EnableUpdate="True"

TableName="titles"

Where="pub_id == @pub_id">

ControlID="DropDownList1"

Name="pub_id"

PropertyName="SelectedValue"

Type="String"/>

Press F5 to debug the application. When you select a publisher now, all books published by that publisher are displayed in the GridViewcontrol (see Figure 17-20).

Figure 1720 Making the Publisher Field Editable Now select a record and - фото 307

Figure 17-20

Making the Publisher Field Editable

Now select a record, and click the Edit link. Notice that the publisher is not editable (see Figure 17-21).

Figure 1721 Heres how to make the publisher field editable In the source - фото 308

Figure 17-21

Here's how to make the publisher field editable. In the source view of Default.aspx, insert the following highlighted code:

ID="DropDownList2"

DataSourceID="LinqDataSource2"

DataTextField="pub_name"

DataValueField="pub_id"

SelectedValue=''

runat="server">

This creates a dropdown list within the GridViewcontrol (under the Publishercolumn) and displays a list of publishers available.

Press F5 to debug the application again. A title's publisher can now be changed (see Figure 17-22).

Figure 1722 Building Responsive Applications Using AJAX One of the - фото 309

Figure 17-22

Building Responsive Applications Using AJAX

One of the challenges developers face in building appealing web applications is overcoming the constant need to refresh entire web pages to update just portions of their content. In the real world, network latencies prevent web applications from refreshing as often as you might want. Typically, when a user submits a request to a web server, the entire page must be refreshed and the user is forced to wait while it makes a round trip to the server even when only a fraction of the page has to be changed. Clearly, this is a key usability issue that developers want to put behind them in their quest to build applications that are more desktop-like in their responsiveness.

Enter AJAX, originally an acronym for Asynchronous JavaScript and XML but increasingly a term that embraces a collection of techniques for creating more responsive and feature- rich web applications. Instead of waiting for web pages to refresh, AJAX-enabled web sites dynamically and asynchronously update portions of the pages, thus providing a much more responsive experience to the user. What's more, with AJAX you can now develop richer applications that draw on the JavaScript and CSS support found in modern web browsers such as Firefox and Internet Explorer (IE) 6 and later. A quick look at the Windows Live Local site (see http://maps.live.com) or Google Spreadsheets (see http://spreadsheets.google.com) should be enough to convince you of the wonders that AJAX can deliver to a user experience.

AJAX is not a product but rather a collection of client-empowering web technologies, including XML, JavaScript, HTTP, the DOM, JSON, and CSS. Writing AJAX-style applications is not easy and has traditionally required that you have an intimate knowledge of client-side scripting languages, most notably JavaScript.

With ASP.NET 3.5, Microsoft has built-in support for AJAX. In the Toolbox, you can find a new tab called AJAX Extensions (see Figure 17-23) containing the various AJAX controls.

Figure 1723 AJAX Control Toolkit While ASPNET 35 comes with a builtin - фото 310

Figure 17-23

AJAX Control Toolkit

While ASP.NET 3.5 comes with a built-in set of controls you can use to create AJAX-style web applications, one of the greatest benefits of AJAX is that its framework is extensible, which allows you and other developers to create your own AJAX controls by extending those that already exist. Microsoft encourages this activity and sponsors an open-source-style project — the AJAX Control Toolkit that makes available a set of controls developed by Microsoft and seeks to involve the community in creating more elements to extend the functionality of AJAX. The AJAX Control Toolkit gives you access to a growing collection of robust controls that give you additional AJAX-style functionality beyond that provided by the basic AJAX framework.

You can download the AJAX Control Toolkit from: http://codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=11121.

You have a choice of two files to download:

AjaxControlToolkit-Framework3-5.zipis the full release package with complete source code to all controls, the test framework, VSI, and more.

AjaxControlToolkit-Framework3.5-NoSource.zipcontains only the sample web site and VSI, and is for people who don't need or want the source code for the controls.

The AJAX Control Toolkit comes with a set of AJAX Extender controls. Unlike the AJAX controls that come with ASP.NET 3.5, you need to manually add these to the Toolbox in Visual Studio 2008. To do so, add a new tab in Toolbox (see Figure 17-24), and name it AJAX Control Toolkit.

Figure 1724 Extract the AjaxControlToolkitFramework35NoSourcezipfile - фото 311

Figure 17-24

Extract the AjaxControlToolkit-Framework3.5-NoSource.zipfile (assuming that you downloaded the version without source code) into a folder (C:\AJAXControlToolkit\, for instance). Inside the new folder is a folder named SampleWebSite\Bin. Drag and drop the AjaxControlToolkit.dlllibrary from that Bin folder onto the new AJAX Control Toolkit tab. The set of AJAX Control Toolkit Extender controls appears, as shown in Figure 17-25.

Figure 1725 AJAX Enabling a Page Using the ScriptManager Control Now - фото 312

Figure 17-25

AJAX- Enabling a Page Using the ScriptManager Control

Now let's use some of the core AJAX controls in ASP.NET 3.5 to AJAX-enable the sample project created earlier in this chapter.

The first step toward AJAX-enabling an ASP.NET web page is to add the ScriptManagercontrol to the page. That's the control that manages all the AJAX functionality on your page. It should be placed before any AJAX controls, so it's a good idea to place it at the top of the page, like this:

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «C# 2008 Programmer's Reference»

Представляем Вашему вниманию похожие книги на «C# 2008 Programmer's Reference» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «C# 2008 Programmer's Reference»

Обсуждение, отзывы о книге «C# 2008 Programmer's Reference» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x