• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • ASP.NET 2.0中使用webpart系列控件(3)

    發表于:2007-06-30來源:作者:點擊數: 標簽:
    使Webpart動起來 上面設計的webpart還沒能動起來,要讓webpart動起來的話,必須要將webpar設置為design display 模式。先為webpart添加下面的radiobutton選擇框 <ASP:RadioButtonList ID="rblMode" runat="server" AutoPostBack="True"> <asp:ListItem>B
         使Webpart動起來
      
        上面設計的webpart還沒能動起來,要讓webpart動起來的話,必須要將webpar設置為design display 模式。先為webpart添加下面的radiobutton選擇框
      
      <ASP:RadioButtonList ID="rblMode" runat="server" AutoPostBack="True">
      ?。糰sp:ListItem>Browse Display Mode</asp:ListItem>
      ?。糰sp:ListItem>Design Display Mode</asp:ListItem>
      </asp:RadioButtonList>
      
        并且在code-behind的代碼中,寫入如下代碼:
      
      Protected Sub RadioButtonList1_SelectedIndExchanged(ByVal sender As Object, _ ByVal e As System.EventArgs) _ Handles rblMode.SelectedIndexChanged
       Select Case rblMode.SelectedIndex
        Case 0 : WebPartManager1.DisplayMode =WebPartManager.BrowseDisplayMode
        Case 1 : WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode
       End Select
      End Sub 
      
        運行上面代碼,選擇design display mode,則可以象下圖那樣,自由拖動webpart,
      
      
      
       要注意的是,當移動各webpart的位置后,即使關掉瀏覽器,下次重新打開時,依然可以看到各個控件保持原來的位置。其實,ASP.NET 2.0是使用在as.netdb.mdf中的一個叫aspnet_PersonalizationPerUser的表來保存數據的,表的結構如下所示:
         
      Field Value
      Id 928e121a-4042-4fb4-9520-21210b9b37c1
      PathId 7c3b5dc0-04d0-48a2-bbb2-2b70286f22fe
      UserId 9bff14df-024f-4bda-9a0a-b4a19ab9e387
      PageSettings <Binary data>
      LastUpdatedDate 10/06/2005 4:44:05 AM
      
        如果想恢復各控件的原來位置,只需要將該數據表中相應的行刪除掉就可以了。但有個問題是,如果使用每一個webpart的關閉按鈕,則很難再將其恢復(當然刪除數據表中的行,但十分麻煩)。在asp.net 2.0中,提供了另一種webpart,叫做catlogzone控件,下面介紹其用法:
      

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>