您现在的位置是:首页 >

aspnet项目开发教程 ASP.NET入门教程 12.8 综合整理[2]

火烧 2021-10-20 22:56:23 1051
ASP.NET入门教程 12.8 综合整理[2] ( )再次将命名空间从tem uri 改为wroxu ited et 即 lt We Service(Name ace:= // wroxu ited

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]

<%@ 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  
永远跟党走
  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

    • 微信收款码
    • 支付宝收款码