Re: ASP.NET Ajax beginner question
- From: "Teemu Keiski" <joteke@xxxxxxxxxxxxxxx>
- Date: Wed, 31 Jan 2007 23:56:23 +0200
I added the config as attachment to this msg. At least you need to have scripting-related stuff there (modules and handlers) but I might add them all. <system.webServer> is IIS 7.0 related stuff (I use Vista), and you can ignore that if you don't use it.
See following link for details what each setting means: http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Hardy Wang" <HardyWang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:5C5479B9-943A-424A-B51F-2D932DB53880@xxxxxxxxxxxxxxxx
VS2005 added following for me automatically, and that's all.<?xml version="1.0"?>
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"/></assemblies>
</compilation>
There are so many keys you listed, I do need to add them all?
"Teemu Keiski" wrote:
That needs still to be set for it to work, But: What does your application's
web.config look like? Setting up ASP.NEt Aajx requires a few lines there.
For example my ASP.NET Ajax enabled app's web.config looks like
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="Everywhere" />
<section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication" />
<section name="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>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add verb="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>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
<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 = "true|false"/>
-->
<!-- 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>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="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"/>
<add name="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>
</configuration>
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Hardy Wang" <HardyWang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E35DCA95-C4AC-4A1A-946C-CB46D587B531@xxxxxxxxxxxxxxxx
> No luck, it is still a postback.
>
> "Teemu Keiski" wrote:
>
>> Hi,
>>
>> you need to set EnablePartialRendering="true" to the >> <asp:ScriptManager>
>>
>> -- >> Teemu Keiski
>> AspInsider, ASP.NET MVP
>> http://blogs.aspadvice.com/joteke
>> http://teemukeiski.net
>>
>>
>>
>> "Hardy Wang" <HardyWang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:B210900B-BEA8-4362-9198-3D27A451EDB5@xxxxxxxxxxxxxxxx
>> > Hi all,
>> > I followed first walk through sample from
>> > http://ajax.asp.net/docs/tutorials/IntroductionUpdatePanel.aspx to
>> > create
>> > my
>> > first testing page, The problem is after I clicked that botton, it
>> > still
>> > trigged a postback. Do I miss something?
>> >
>> > Following is my code:
>> >
>> > <%@ Page Language="C#" AutoEventWireup="true"
>> > CodeFile="Default.aspx.cs"
>> > Inherits="_Default" %>
>> >
>> > <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
>> > Culture=neutral, PublicKeyToken=31bf3856ad364e35"
>> > Namespace="System.Web.UI" TagPrefix="asp" %>
>> >
>> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> >
>> > <html xmlns="http://www.w3.org/1999/xhtml" >
>> > <head runat="server">
>> > <title>Untitled Page</title>
>> > </head>
>> > <body>
>> > <form id="form1" runat="server">
>> > <div>
>> > <asp:ScriptManager ID="ScriptManager1" runat="server">
>> > </asp:ScriptManager>
>> > <asp:UpdatePanel ID="UpdatePanel1" runat="server">
>> > <ContentTemplate>
>> > <asp:Label ID="Label1" runat="server" Text="Parcel
>> > created"></asp:Label>
>> > <asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
>> > Text="Button" />
>> > </ContentTemplate>
>> > </asp:UpdatePanel>
>> > </div>
>> > </form>
>> > </body>
>> > </html>
>> >
>> >
>> >
>> > using System;
>> > using System.Data;
>> > using System.Configuration;
>> > using System.Web;
>> > using System.Web.Security;
>> > using System.Web.UI;
>> > using System.Web.UI.WebControls;
>> > using System.Web.UI.WebControls.WebParts;
>> > using System.Web.UI.HtmlControls;
>> >
>> > public partial class _Default : System.Web.UI.Page
>> > {
>> > protected void Page_Load(object sender, EventArgs e)
>> > {
>> >
>> > }
>> >
>> > protected void Button1_Click(object sender, EventArgs e) {
>> > Label1.Text = "Refreshed at " + DateTime.Now.ToString();
>> > }
>> > }
>> >
>> > Html code generated by page
>> >
>> >
>> >
>> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> >
>> > <html xmlns="http://www.w3.org/1999/xhtml" >
>> > <head><title>
>> > Untitled Page
>> > </title></head>
>> > <body>
>> > <form name="form1" method="post" action="Default.aspx" >> > id="form1">
>> > <div>
>> > <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" >> > value=""
>> > />
>> > <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT"
>> > value=""
>> > />
>> > <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
>> > value="/wEPDwULLTEyNTU5OTE4NDBkZFFbG+xINimfJjnJzMPyN5/bdPcr" />
>> > </div>
>> >
>> > <script type="text/javascript">
>> > <!--
>> > var theForm = document.forms['form1'];
>> > if (!theForm) {
>> > theForm = document.form1;
>> > }
>> > function __doPostBack(eventTarget, eventArgument) {
>> > if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
>> > theForm.__EVENTTARGET.value = eventTarget;
>> > theForm.__EVENTARGUMENT.value = eventArgument;
>> > theForm.submit();
>> > }
>> > }
>> > // -->
>> > </script>
>> >
>> >
>> > <script
>> > src="/AjaxSandbox/WebResource.axd?d=uPSIJPV09GNZkXa1aWLuZA2&t=632961560341637622"
>> > type="text/javascript"></script>
>> >
>> >
>> > <script
>> > src="/AjaxSandbox/ScriptResource.axd?d=Rdf9isNeXMPi-qNzO-XVRmXNOH0DmLQG-4RxW5WORPfrZ2K0YD5Icg_Bz9c5f0-wuytwMMng0hZa1k1SSKrW5yqEjrhREy__cV5gKfSghPU1&t=633053156500271737"
>> > type="text/javascript"></script>
>> > <script
>> > src="/AjaxSandbox/ScriptResource.axd?d=Rdf9isNeXMPi-qNzO-XVRmXNOH0DmLQG-4RxW5WORPfrZ2K0YD5Icg_Bz9c5f0-wuytwMMng0hZa1k1SSKrW572e2ypQhyGf_JtyUNuUy11_drtp-tXJrGLYVAgwBUoK0&t=633053156500271737"
>> > type="text/javascript"></script>
>> > <div>
>> > <script type="text/javascript">
>> > //<![CDATA[
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="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>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="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>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
<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 = "true|false"/>
-->
<!-- 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>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="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"/>
<add name="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>
</configuration>
- References:
- ASP.NET Ajax beginner question
- From: Hardy Wang
- Re: ASP.NET Ajax beginner question
- From: Teemu Keiski
- Re: ASP.NET Ajax beginner question
- From: Hardy Wang
- Re: ASP.NET Ajax beginner question
- From: Teemu Keiski
- Re: ASP.NET Ajax beginner question
- From: Hardy Wang
- ASP.NET Ajax beginner question
- Prev by Date: Re: ASP.NET Ajax beginner question
- Next by Date: Re: using the ~/ path with script files?
- Previous by thread: Re: ASP.NET Ajax beginner question
- Next by thread: The state information is invalid for this page and might be corrupted
- Index(es):
Loading