并且点击“App-Code”。
4.右击Solutions Explorer窗口中的“App-Code”文件夹并且点击“Add Existing Item”。
5.从“Add Existing Item”对话框中浏览到你前面所创建的代理文件,选择它并且点击“Add”;这将把服务代理文件添加到工程中。
(四) 创建客户端UI
1.在Solutions Explorer中,双击Default.aspx文件,从而在Visual Studio designer窗口中打开它。
2.请确保你位于源码视图中,然后在文档的<form id="form1" runat="server">和</form>之间复制并粘贴下列代码:
<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" EnableScriptComponents="true"/>
<asp:Label ID="Label1" runat="server" Width="366px" Font-Bold="True" Font-Names="Verdana Ref" Font-Size="Small" Height="19px">SEARCH FOR RESTAURANTS WITH AMAZON.COM</asp:Label><br />
<br />
<asp:Label ID="Label2" runat="server" Text="Access Key ID:" Width="128px" Font-Names="Verdana Ref"></asp:Label>
<asp:TextBox ID="TxtBAccessKey" runat="server" Width="182px" Font-Names="Verdana Ref"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
Width="16px" ControlToValidate="TxtBAccessKey"></asp:RequiredFieldValidator><br />
<asp:Label ID="Label3" runat="server" Text="Cuisine:" Font-Names="Verdana" Width="58px"></asp:Label>
<!--The ListBoxCuisine ListBox holds all possible entries for the Cuisine parameter supported by the amazon ECS-->
<asp:ListBox ID="ListBoxCuisine" runat="server" Rows="1" Width="206px" OnSelectedIndexChanged="ListBoxCuisine_SelectedIndexChanged" Font-Names="Verdana Ref" AutoPostBack="True">
<asp:ListItem Text="American cuisine" Value="American cuisine"></asp:ListItem>
<asp:ListItem Text="Asian cuisine" Value="Asian cuisine"></asp:ListItem>
<asp:ListItem Text="Seafood" Value="Seafood"></asp:ListItem>
<asp:ListItem Text="Greek" Value="Greek"></asp:ListItem>
<asp:ListItem Text="Indian" Value="Indian"></asp:ListItem>
<asp:ListItem Text="Italian" Value="Italian"></asp:ListItem>
<asp:ListItem Text="Japanese" Value="Japanese"></asp:ListItem>
<asp:ListItem Text="Chinese" Value="Chinese"></asp:ListItem>
</asp:ListBox>
<br />
<asp:Label ID="Label5" runat="server" Font-Names="Verdana" Text="City:"
Width="61px">
</asp:Label>
<!a€”The Amazon E-Commerce Service supports only the cities defined as list items of the ListBox contr
|