AJAX Control Toolkit——PopupControlExtender(快顯視窗)

來源:互聯網
上載者:User

PopupControl is an ASP.NET AJAX extender that can be attached to any control in order to open a popup window that displays additional content. This popup window will probably be interactive and will probably be within an ASP.NET AJAX UpdatePanel, so it will be able to perform complex server-based processing (including postbacks) without affecting the rest of the page. The popup window can contain any content, including ASP.NET server controls, HTML elements, etc. Once the work of the popup window is done, a simple server-side call dismisses it and triggers any relevant script on the client to run and update the page dynamically.

TargetControlID——附加到的控制項的ID

PopupControlID——彈出顯示的控制項ID

Position——彈出控制項相對目標控制項的位置(Left,Right, Top, Bottom, Center)

CommitProperty——目標控制項要從彈出控制項得到的屬性值(可選)

CommotScript——擷取彈出控制項屬性值的指令碼

OffsetX/OffsetY——水平、豎直方向距預設位置的位移距離

Animations

——OnShow

——OnHide

範例程式碼:

 1 <asp:ScriptManager ID="ScriptManager1" runat="server" />
2 <div>
3 <br />
4 ToDo:
5 <asp:TextBox ID="MyTextBox" runat="server" Width="538px"></asp:TextBox>
6 <br />
7 <asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
8 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
9 <ContentTemplate>
10 <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
11 Width="146px">
12 <asp:ListItem Text="Scott Guthrie" ></asp:ListItem>
13 <asp:ListItem Text="Simon Muzio"></asp:ListItem>
14 <asp:ListItem Text="Brian Goldfarb"></asp:ListItem>
15 <asp:ListItem Text="Joe Stagner"></asp:ListItem>
16 <asp:ListItem Text="Shawn Nandi"></asp:ListItem>
17 </asp:RadioButtonList>
18 </ContentTemplate>
19 </asp:UpdatePanel>
20 </asp:Panel>
21 <br />
22 <ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" CommitProperty="value"
23 CommitScript="e.value += ' - SEND A MEETING REQUEST!';" PopupControlID="Panel1"
24 Position="Bottom" TargetControlID="MyTextBox">
25 </ajaxToolkit:PopupControlExtender>
26
27 </div>

簡單CSS

.popupControl
{
background-color:#AAD4FF;
position:absolute;
visibility:hidden;
border-style:solid;
border-color: Black;
border-width: 2px;
}

  

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.