nini

学然后知不足,教然后知困
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

3. 创建一个ASP.NET AJAX Futures 的启动模型

Posted on 2007-03-30 21:59  nini  阅读(1574)  评论(0编辑  收藏  举报

 

 

导论和目标

1. 安装ASP.NET AJAX v1.0

2. 使用Visual Studio 2005准备开发ASP.NET AJAX应用

3. 创建一个ASP.NET AJAX Futures 的启动模型 

4. 使用AJAX扩展xBikes解决方案 

4.1 添加ScriptManager and UpdatePanel

4.2 执行异步请求时显示通知 

4.3 使用AutoCompleteExtender异步调用Web service 

4.4 使用AJAX Control Toolkit中的例子 

4.5 拖拽功能

4.6 在AJAX Framework中使用ASP.NET’s Profile服务 

4.7 创建你自己的ASP.NET AJAX 控件扩展 


 

 

任务:现在,xBikes解决方案仍然缺少使用ASP.NET AJAX的几个主要元素。其中一个是,我们需要Microsoft.Web.Preview.dll程序集和相应的web.config文件。获得他们最容易的方法就是我们新建一个空白的ASP.NET AJAX CTP-Enabled Web Site项目,并将相应的文件复制过去。

步骤 3a:启动Visual Studio 2005并打开”文件->新建Website”。创建一个新的ASP.NET AJAX CTP-Enabled Web Site解决方案。

图 3a: 创建空白的 "ASP.NET AJAX CTP-Enabled Web Site" 解决方案

这个ASP.NET AJAX-Enabled Web Site解决方案包的项目类型中已经包含了附加的Microsoft.Web.Preview.dll程序集和web.config中必需的注册。这些都是AJAX Futures CTP中必需的,也是我们后面的解决方案中必需的。

步骤3b: 打开xBikes解决方案,将web.config重命名为old.config。因为我们仍然需要已写好的配置小节,所以要避免损坏和覆盖掉该文件的内容。

从新创建的站点中(AJAX CTP Site)复制web.config文件,并粘贴到xBikes解决方案目录中。

同样的,把AJAX CTP Site中的/bin文件夹复制到xBikes解决方案中。

现在关闭Visual Studio 2005 中的AJAX CTP Site实例,并且在打开xBikes实例的Visual Studio 2005中刷新解决方案浏览器。

步骤3c:打开配置文件web.config和old.config。

把原有的的web.config中有关信息复制到新的web.config中。在本文中,我们将处理2个元素。分别时:Connection Strings和Authentication and Profile Settings

确定Connection Strings元素<connectiostring>在<system.web>之前,Authentication and Profile Settings在<system.web>之后。

 


  
</sectionGroup>
  
</configSections>
    
<!-- Connection Strings -->
    
<connectionStrings>
        
<remove name="LocalSqlServer" />
        
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" />
        
<add name="xBikesSQLConnectionString" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|xBikesSQL.mdf" providerName="System.Data.SqlClient" />
    
</connectionStrings>
    
<!-- End Connection Strings -->
  
<system.web>
      
<!-- Authentication and Profile Settings -->
      
<authentication mode="Forms" />
      
<anonymousIdentification enabled="true" />
      
<profile>
          
<properties>
              
<add name="ShoppingBasket" allowAnonymous="true" type="ShoppingBasket" serializeAs="Binary" />
          
</properties>
      
</profile>
      
<!-- End Authentication and Profile Settings -->
    
<pages>
      
<controls>


 

图3b:修改后的部分web.config

我们不需要修改web.config的其他任何地方了。

我们创建的AJAX CTP Site不再有用,所以,你可以像在xBikes解决方案中清除old.config一样的来清除它。