Saturday, January 9, 2010

Configuring ASP.NET AJAX

Configuring ASP.NET AJAX
Introduction

This topic describes the elements in the Web.config file that support Microsoft ASP.NET AJAX. It also describes how to incorporate those elements into the Web.config file for an existing ASP.NET application.
Using the ASP.NET AJAX Web Configuration File in a New Web Site

When you create a new AJAX-enabled Web site, you can use the Web.config file provided in the installation package to add the required configuration settings. In Visual Studio, the Web.config file for Microsoft ASP.NET AJAX is included in your project when you create a new ASP.NET AJAX-enabled Web Site.

If you have to manually add the Web.config file to a new Web site, you can get a copy of it from the installation path. By default, the file is in the following location:

drive:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.nnnn

Adding ASP.NET AJAX Configuration Elements to an Existing Web Site

In an existing Web site, you typically have values in the Web.config file that you want to retain. In that case, you can add the new ASP.NET AJAX elements into the existing Web.config file.

The new elements are part of the following configuration sections:

*

The element
*

The element
*

The element
*

The element
*

The element
*

The element
*

The element

The Element

The element creates a configuration section and subsections for the SystemWebExtensionsSectionGroup class. You set the properties for these sections in the element.

The following example shows the element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the element.



type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
type="System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication"/>
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false" allowDefinition="Everywhere" />
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication" />
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication" />






The Element

The element registers ASP.NET AJAX namespaces in the System.Web.Extensions assembly and maps the asp tag prefix as an alias for these namespaces. The controls in the ASP.NET AJAX namespaces can be referenced in a Web page with syntax such as the following:



The following example shows the element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the element.









The Element

The element registers the System.Web.Extensions assembly.

The following example shows the element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the element.









The Element

The element adds new handlers for script requests.

The following example shows the element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the element.










The Element

The element defines HTTP modules used in ASP.NET AJAX.

The following example shows the element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the element.







The Element

The element provides elements that can be uncommented to configure how Web services are called from Microsoft ASP.NET AJAX applications. The element is used to specify custom type converters and to override default settings for JSON serialization. The element specifies custom type converters. The element is used to enable or disable the authentication service. The element is used to enable or disable the profile service and to specify which properties are exposed by the service. The element is used to enable or disable caching and compression of resources used with scripts.

The element, element, and element can be defined only in the Machine.config file or in the Web.config file in the application root directory. The element can be defined in the Machine.config file, in the Web.config file in the application root directory, or in a Web.config file in a subfolder of the Web site.

The following example shows the element for ASP.NET AJAX. Add this section and its subsections to the existing Web.config file as a child of the element.
















The Element

The element contains configuration settings used by Microsoft Internet Information Server (IIS) 7.0.

The following example shows the element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the element.




preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>



preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />



See Also
reference By:
http://www.asp.net/ajax/documentation/live/ConfiguringASPNETAJAX.aspx

No comments: