9/17/2008

Required Entries in web.config file for ASP.NET AJAX applications to run properly.

Before you start this , I recommending you reading ‘ How to remove 'Sys' is undefined ? ’

Following are the required entries in your web.config file for the ASP.NET AJAX applications to work with out errors. If you are integrating AJAX in your ASP.NET 2.0 application , then only you need to check this .If you are creating from AJAX Enabled website template in Visual Studio , these will be added automatically .

1.CONFIG Sections : For registering the system.web.extensions namespace, assembly and the various handlers that are used in handling AJAX requests.

<configSections>

<sectionGroupname="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
">

<sectionGroupname="scripting"type=
"System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
">

<sectionname="scriptResourceHandler"type=
"System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="MachineToApplication"/>

<sectionGroupname="webServices"type=
"System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
">

<sectionname="jsonSerialization"type=
"System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="Everywhere"/>

<sectionname="profileService"type=
"System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="MachineToApplication"/>

<sectionname="authenticationService"type=
"System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="MachineToApplication"/>

</sectionGroup>

</sectionGroup>

</sectionGroup>

</configSections>

2. In your system.web Node , Make sure you have these entries so that we can register the " asp " tag prefix to AJAX Controls .

<pages>

<controls>

<addtagPrefix="asp"namespace="System.Web.UI"assembly=
"System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"/>

</controls>

</pages>

3. Now find
<compilationdebug="false> and add the following.This enables compilation of your website by referring to the following assemblies.

<compilationdebug="true">

<assemblies>

<addassembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addassembly="System.Web.Extensions.Design,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35
"/>

</assemblies>

</compilation>

4.Now to ensure that that your HTTP handler is registered and to specify that webservices might be handled by Async Callbacks (from JavaScript) Check for following lines or add them.

<httpHandlers>

<removeverb="*"path="*.asmx"/>

<addverb="*"path="*.asmx"validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"/>

<addverb="*"path="*_AppService.axd"validate="false"type=
"System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addverb="GET,HEAD"path="ScriptResource.axd"type=
"System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"validate="false"/>

</httpHandlers>

<httpModules>

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

</httpModules>

5.Now add the following after </system.web> tag.We add these lines to enable Json Serialisation or, authentication settings and some profile settings.Check for these lines or add them.

<system.web.extensions>

<scripting>

<webServices>

<!-- Uncomment this line to customize maxJsonLength
and add a custom converter
-->

<!--

<jsonSerialization maxJsonLength="500">

<converters>

<add name="ConvertMe" type=
"Acme.SubAcme.ConvertMeTypeConverter"/>

</converters>

</jsonSerialization>

-->

<!-- Uncomment this line to enable the
authentication service. Include requireSSL="true" if appropriate.
-->

<!--

<authenticationService enabled="true" requireSSL = "truefalse"/>

-->

<!-- Uncomment these lines to enable the profile service.
To allow profile properties to be retrieved and modified in
ASP.NET AJAX applications, you need to add each property
name to the readAccessProperties and

writeAccessProperties attributes. -->

<!-- <profileService enabled="true" readAccessProperties=
"propertyname1,propertyname2"

writeAccessProperties="propertyname1,propertyname2" />

-->

</webServices>

<!--

<scriptResourceHandler enableCompression="true" enableCaching="true" />

-->

</scripting>

</system.web.extensions>

6.Finally you have to register the script handler factory which will be done by the following lines.Check for them or add them to your web.config

<system.webServer>

<validationvalidateIntegratedModeConfiguration="false"/>

<modules>

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

</modules>

<handlers>

<removename="WebServiceHandlerFactory-Integrated"/>

<addname="ScriptHandlerFactory"verb="*"path="*.asmx"
preCondition
="integratedMode"type=
"System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addname="ScriptHandlerFactoryAppServices"verb="*"
path="*_AppService.axd"preCondition="integratedMode"
type
="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addname="ScriptResource"preCondition="integratedMode"
verb
="GET,HEAD"
path="ScriptResource.axd"type=
"
System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

</handlers>

</system.webServer>


Simple ain't it ? For getting Simpler solutions ,Subscribe to Technova feed or click here to get updates via email .

3 comments:

Generic Viagra is an effective treatment for male erectile dysfunction, or ED. This is also known as impotence. Generic Viagra online is a little blue pill you take only when you want to have sex. Generic Generic Cialis helps men consistently get and keep an erection when they become sexually stimulated.

cao hong sam là một trong những loại thảo dược tự nhiên, có mặt ở rất nhiều quốc gia trên thế giới như Nhật Bản, Hàn Quốc, Hoa Kì... cao hồng sâm Trong các loại nhân sâm kể trên thì nhân sâm hàn quốc luôn được hàng triệu người trên khắp thế giới cao hồng sâm hàn quốc săn lùng và tìm kiếm bởi những giá trị tuyệt vời. Từ xưa đến nay những công dụng của loại nhân sâm này vẫn được mọi người lưu truyền và cao hong sam han quoc ứng dụng vào trong đời sống đặc biệt là chăm sóc sức khỏe của con người. Củ nhân sâm Hàn Quốc chính là cao sâm hàn quốc ở dạng tươi chưa qua sơ chế thành các sản phẩm. cao sam han quoc có những vai trò và tác dụng vô cùng to lớn đối với con người.

Post a Comment