aspnet项目开发教程 ASP.NET入门教程 12.8 综合整理[2]
ASP.NET入门教程 12.8 综合整理[2]
( )再次将命名空间从tempuri 改为wroxunited net 即<WebService(Namespace:= // wroxunited net/ )>
( )保存这个文件
( )现在需要创建可以利用这个Web服务的页面 创建称为LeagueView ascx的新Web用户控件 并且向其添加一个GridView控件 在设计视图中双击
Partial Class LeagueView
Inherits System Web UI UserControl
Protected Sub Page_Load(ByVal sender As Object ByVal e As System EventArgs) Handles Me Load
Dim wsConvert As New LeagueMiniView
gridview datasource = wsConvert ViewLeague
GridView DataBind()
End Sub
End Class
( )保存该页面 现在 通过调整该页面的代码如下 可以向default aspx添加这个控件
<%@ Register Src= LeagueView ascx TagName= LeagueView TagPrefix= uc %>
![aspnet项目开发教程 ASP.NET入门教程 12.8 综合整理[2]](http://img.zhputi.com/uploads/6846/68463b1f97b9b45b24e872f3416d4a108145.jpg)
<%@ Register TagPrefix= wu TagName= News Src= News ascx %>
<asp:Content ID= Content ContentPlaceHolderID= mainContent Runat= server >
<h >Wele to the Wrox United Web site </h >
<p>We re a great football team No really we are Don t take any notice
of our past performance We re just unlucky </p>
<uc :LeagueView ID= miniview runat= server />
<wu:news id= News runat= server ItemsToShow= ></wu:news>
</asp:Content>
( )现在转到default aspx并查看它
lishixinzhi/Article/program/net/201311/14733