惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
H
Help Net Security
小众软件
小众软件
N
Netflix TechBlog - Medium
C
Check Point Blog
量子位
Last Week in AI
Last Week in AI
GbyAI
GbyAI
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
D
DataBreaches.Net
Project Zero
Project Zero
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Security Latest
Security Latest
Cisco Talos Blog
Cisco Talos Blog
Recorded Future
Recorded Future
I
Intezer
L
Lohrmann on Cybersecurity
Cyberwarzone
Cyberwarzone
博客园_首页
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
P
Palo Alto Networks Blog
V
V2EX
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
The Hacker News
The Hacker News
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
The Register - Security
The Register - Security
L
LINUX DO - 热门话题
P
Privacy & Cybersecurity Law Blog
Scott Helme
Scott Helme
F
Full Disclosure
博客园 - 司徒正美
Recent Announcements
Recent Announcements
IT之家
IT之家
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Attack and Defense Labs
Attack and Defense Labs
Cloudbric
Cloudbric
Help Net Security
Help Net Security
The Last Watchdog
The Last Watchdog

博客园 - 蓝箭GZ

[转载]AgileEAS.NET 敏捷软件开发平台 致力于中小企业快速应用开发 原创:分享通过简单设置提速3D游戏!(如果内存大,请禁用虚拟内存。) 原创:EXT2.0通过ASP动态生成json数据并分页! 原创:分享大内存的XP系统终极优化经验! 原创:VS2005开发的一些实用经验一(VB.NET--WINFORM) 转贴:Vbs脚本编程简明教程! 终于找到一款非常强大的程序代码编辑器PrimalScript v4.0.484汉化版! 空牙-游戏音乐合成视频 转:怀念街机的那段传奇历史 原创:基于VB的ASP.NET2.0的事务及错误处理 原创:Flash cs3 等软件不能在win2003sp1上安装的问题解决(安装遇到错误无法继续, 无法访问Windows Installer服务......) 原创:简单的ASP无组件上传原理实践总结! 转贴:检测系统颜色与使用字体 原创:我理解的ActiveX组件和对象 (转贴) Microsoft XML 分析器 (MSXML) 的版本列表 (转贴) Microsoft .NET Framework 的版本列表 关于网上的一篇很好的文章(RECORDSET对象详解)所存在的错误! (转贴) ADO.NET的开发场景及传统ADO的处理 (转贴) 数据库设计三大范式应用实例剖析
原创:ASP.NET2.0中使用AJAX1.0控件的一点经验
蓝箭GZ · 2008-03-17 · via 博客园 - 蓝箭GZ

第一次用ajax.1.0控件,下载安装ASP.NET AJAX1.0后,在VS中建立网站时多了一个选项:ASP.NET AJAX-Enabled Web Site,以及工具栏中多了AJAX Extensions选项,包括有ScriptManager,UpdatePanel等控件,

分两种情况:

第一种情况,新建的网站是通过ASP.NET AJAX-Enabled Web Site而新建的,就比较好办,先放入ScriptManager控件,后放入UpdatePanel控件,再将GridView等需要PostBack才能更新或编辑的控件放入UpdatePanel中,这样就可以简单地实现GridView控件无刷新更新数据的效果了;

第二种情况是,已经新建了网站,但不是通过ASP.NET AJAX-Enabled Web Site这个选项而新建的,这时,加入ScriptManage控件,后放入UpdatePanel控件是会出错的,如:“Sys 未定义”等,这样就要修改网站根目录下的web.config文件,加入如下内容:

1.一定要在<configuration>的后面(规定<configSections>要是它的第一个子项),加入

<configuration>

<!--这是加入支持ajax控件的设置1-->

 <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>

<!--这是加入支持ajax控件的设置1-->

2.在<page>后面加入:

<!--这是加入支持ajax控件的设置2-->

      <controls>

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

      </controls>

<!--这是加入支持ajax控件的设置2-->

</pages>

3.接上面加入

</pages>

 <!--这是加入支持ajax控件的设置3-->

    <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>

<!--这是加入支持ajax控件的设置3-->

4.最后在</system.web>后面加入

</system.web>

<!--这是加入支持ajax控件的设置4-->

 <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>

<!--这是加入支持ajax控件的设置4-->

</configuration>

这样旧的项目也可以支持asp.net ajax1.0的功能了。