在第一个实做中采用的是客户端的HTML组件和客户端脚本实现的客户端界面以及无刷新的功能。
在第二个实战中是通过添加服务器端的组件实现的客户端组件和无刷新功能(这个实做调用的也是第一个实做中的webservice)。
实做二中的ASPX页面的HTML代码如下:
 <%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Atlas HOL 2" %>
<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Atlas HOL 2" %>
 <asp:Content ID="Content3" ContentPlaceHolderID="Main" Runat="Server">
<asp:Content ID="Content3" ContentPlaceHolderID="Main" Runat="Server">
 <form action="">
<form action="">
 <div>
  <div>
 Search for
    Search for 
 <input id="SearchKey" type="text" />
    <input id="SearchKey" type="text" />
 <input id="SearchButton" type="button" value="Search" />
    <input id="SearchButton" type="button" value="Search" />
 </div>
  </div>
 </form>
</form>
 <hr style="width: 300px" />
<hr style="width: 300px" />
 <div>
<div>
 <span id="Results"></span>
  <span id="Results"></span>
 </div>
</div>
 <script type="text/xml-script">
<script type="text/xml-script">
 <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
  <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
 <references>
    <references>
 <add src="ScriptLibrary/AtlasUI.js" />
        <add src="ScriptLibrary/AtlasUI.js" />
 <add src="ScriptLibrary/AtlasControls.js" />
        <add src="ScriptLibrary/AtlasControls.js" />
 </references>
    </references>
 <components>
    <components>
 <textBox id="SearchKey" />
        <textBox id="SearchKey" />

 <serviceMethod id="helloService" url="HelloWorldService.asmx"
        <serviceMethod id="helloService" url="HelloWorldService.asmx" 
 methodName="HelloWorld">
          methodName="HelloWorld">
 <bindings>
          <bindings>
 <binding dataContext="SearchKey" dataPath="text"
            <binding dataContext="SearchKey" dataPath="text" 
 property="parameters" propertyKey="query" />
              property="parameters" propertyKey="query" />
 </bindings>
          </bindings>
 <completed>
          <completed>
 <invokeMethod target="resultsBinding"
            <invokeMethod target="resultsBinding" 
 method="evaluateIn" />
              method="evaluateIn" />
 </completed>
          </completed>
 </serviceMethod>
        </serviceMethod>

 <button targetElement="SearchButton">
        <button targetElement="SearchButton">
 <click>
          <click>
 <invokeMethod target="helloService" method="invoke" />
            <invokeMethod target="helloService" method="invoke" />
 </click>
          </click>
 </button>
        </button>

 <label targetElement="results">
        <label targetElement="results">
 <bindings>
          <bindings>
 <binding id="resultsBinding" dataContext="helloService"
            <binding id="resultsBinding" dataContext="helloService" 
 dataPath="response.object" property="text"
              dataPath="response.object" property="text" 
 automatic="false" />
              automatic="false" />
 </bindings>
          </bindings>
 </label>
        </label>

 </components>
    </components>
 </page>
  </page>
 </script>
</script>
 </asp:Content>
</asp:Content>


重点是<page xmlns:script="http://schemas.microsoft.com/xml-script/2005"></page>中的段落,在这个段落中定义了一个<references>段和一个<components>段。其中<references>段中定义的是引用到的客户端JavaScript脚本,<components>段中定义的是用于生成客户端UI、方法调用的XML。这样在以后版本的Atlas中应该就可以直接通过可视的方法创建UI以及定义动作和事件了。
在第二个实战中是通过添加服务器端的组件实现的客户端组件和无刷新功能(这个实做调用的也是第一个实做中的webservice)。
实做二中的ASPX页面的HTML代码如下:
 <%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Atlas HOL 2" %>
<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Atlas HOL 2" %> <asp:Content ID="Content3" ContentPlaceHolderID="Main" Runat="Server">
<asp:Content ID="Content3" ContentPlaceHolderID="Main" Runat="Server"> <form action="">
<form action=""> <div>
  <div> Search for
    Search for  <input id="SearchKey" type="text" />
    <input id="SearchKey" type="text" /> <input id="SearchButton" type="button" value="Search" />
    <input id="SearchButton" type="button" value="Search" /> </div>
  </div> </form>
</form> <hr style="width: 300px" />
<hr style="width: 300px" /> <div>
<div> <span id="Results"></span>
  <span id="Results"></span> </div>
</div> <script type="text/xml-script">
<script type="text/xml-script"> <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
  <page xmlns:script="http://schemas.microsoft.com/xml-script/2005"> <references>
    <references> <add src="ScriptLibrary/AtlasUI.js" />
        <add src="ScriptLibrary/AtlasUI.js" /> <add src="ScriptLibrary/AtlasControls.js" />
        <add src="ScriptLibrary/AtlasControls.js" /> </references>
    </references> <components>
    <components> <textBox id="SearchKey" />
        <textBox id="SearchKey" />
 <serviceMethod id="helloService" url="HelloWorldService.asmx"
        <serviceMethod id="helloService" url="HelloWorldService.asmx"  methodName="HelloWorld">
          methodName="HelloWorld"> <bindings>
          <bindings> <binding dataContext="SearchKey" dataPath="text"
            <binding dataContext="SearchKey" dataPath="text"  property="parameters" propertyKey="query" />
              property="parameters" propertyKey="query" /> </bindings>
          </bindings> <completed>
          <completed> <invokeMethod target="resultsBinding"
            <invokeMethod target="resultsBinding"  method="evaluateIn" />
              method="evaluateIn" /> </completed>
          </completed> </serviceMethod>
        </serviceMethod>
 <button targetElement="SearchButton">
        <button targetElement="SearchButton"> <click>
          <click> <invokeMethod target="helloService" method="invoke" />
            <invokeMethod target="helloService" method="invoke" /> </click>
          </click> </button>
        </button>
 <label targetElement="results">
        <label targetElement="results"> <bindings>
          <bindings> <binding id="resultsBinding" dataContext="helloService"
            <binding id="resultsBinding" dataContext="helloService"  dataPath="response.object" property="text"
              dataPath="response.object" property="text"  automatic="false" />
              automatic="false" /> </bindings>
          </bindings> </label>
        </label>
 </components>
    </components> </page>
  </page> </script>
</script> </asp:Content>
</asp:Content>

重点是<page xmlns:script="http://schemas.microsoft.com/xml-script/2005"></page>中的段落,在这个段落中定义了一个<references>段和一个<components>段。其中<references>段中定义的是引用到的客户端JavaScript脚本,<components>段中定义的是用于生成客户端UI、方法调用的XML。这样在以后版本的Atlas中应该就可以直接通过可视的方法创建UI以及定义动作和事件了。
 
                     
                    
                 
                    
                 
                
 
 
         
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号