()再次将命名空间从tempuriorg改为wroxunitednet即<WebService(Namespace:=http://wwwwroxunitednet/)>
()保存这个文件
()现在需要创建可以利用这个Web服务的页面创建称为LeagueViewascx的新Web用户控件并且向其添加一个GridView控件在设计视图中双击
Partial Class LeagueView
Inherits SystemWebUIUserControl
Protected Sub Page_Load(ByVal sender As Object ByVal e As SystemEventArgs) Handles MeLoad
Dim wsConvert As New LeagueMiniView
gridviewdatasource = wsConvertViewLeague
GridViewDataBind()
End Sub
End Class
()保存该页面现在通过调整该页面的代码如下可以向defaultaspx添加这个控件
<%@ Register Src=LeagueViewascx TagName=LeagueView TagPrefix=uc %>
<%@ Register TagPrefix=wu TagName=News Src=Newsascx %>
<asp:Content ID=Content ContentPlaceHolderID=mainContent Runat=server>
<h>Welcome to the Wrox United Web site</h>
<p>Were a great football team No really we are Dont take any notice
of our past performance Were just unlucky</p>
<uc:LeagueView ID=miniview runat=server />
<wu:news id=News runat=server ItemsToShow=></wu:news>
</asp:Content>
()现在转到defaultaspx并查看它
[] [] [] [] [] []