ATLAS拖拉之簡單小結

來源:互聯網
上載者:User

有了atlas的話,做一些隨意拖拉的效果就十分容易了。在vs.net 2005下,裝了atlas的話,有很多控制項
可以實現之,下面小結之

1、使用<atlas:DragOverlayProperties> 控制項,比如
 <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
        <atlas:DragOverlayExtender ID="DragOverlayExtender1" runat="server">
            <atlas:DragOverlayProperties TargetControlID="Panel1" Enabled="true" ProfileProperty="Panel1Loc" />
                  </atlas:DragOverlayExtender>
        <atlas:ProfileScriptService ID="ProfileScriptService1" runat="server" AutoSave="true" />
        <div>
            <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="Panel1" runat="server" BorderStyle="Solid" Height="198px" Width="194px">

                  //在這裡寫你要寫的東西,比如一張圖片
</asp:Panel>
                </ContentTemplate>
            </atlas:UpdatePanel>
而如果為了要記住每次拖拉後的位置,還要在web.config裡設定,如
<system.web>
    <profile>
      <properties>
        <add name="Panel1Loc" type="System.String" />
      </properties>
    </profile>

<profileService enabled="true"
                    setProperties="Panel1Loc"
                    getProperties="Panel1Loc"
/>
這樣設定好profile的服務,能夠讀和寫這個位置的屬性panel1loc,然後如上文說的那樣設定:
 <atlas:DragOverlayExtender ID="DragOverlayExtender1" runat="server">
            <atlas:DragOverlayProperties TargetControlID="Panel1" Enabled="true" ProfileProperty="Panel1Loc" />
                  </atlas:DragOverlayExtender>
        <atlas:ProfileScriptService ID="ProfileScriptService1" runat="server" AutoSave="true" />
其中targetControlID指明了對panel1進行拖拉,要記住位置的屬性是profileproperty來指定的,而
對profileScriptService設定autosave為true,則記住每次拖拉後的位置。

2、也可以使用atlas tookit中的DragPanelExtender控制項,
比如
<cc1:DragPanelExtender ID="DragPanelExtender1" runat="server">
            <cc1:DragPanelProperties DragHandleID="Panel2" TargetControlID="Panel1" />
        </cc1:DragPanelExtender>

其中可以設定一個拖拉的地區,比如panel2,放一個提示性的文字,然後要被跟著一起拖拉的
地區設定為panel1,再分別用draghandelid,targetcontrolid來設定之。但用dragpanelExtender的話,不會每次
記住拖拉後的位置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.