1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdatePanel.aspx.cs" Inherits="ZeeControls2Demo.WebDock.Advanced.UpdatePanel" Theme="Default" %>
2
3 <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
4 Namespace="System.Web.UI" TagPrefix="asp" %>
5
6 <%@ Register Assembly="ZettaCube.ZeeControls" Namespace="ZettaCube.ZeeControls" TagPrefix="cc1" %>
7
8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
9
10 <html xmlns="http://www.w3.org/1999/xhtml" >
11 <head runat="server">
12 <title>Customized Update Panel</title>
13 <script type="text/javascript" src="../../common.js"></script>
14
15 </head>
16 <body>
17 <form id="form1" runat="server">
18 <div>
19 <asp:ScriptManager ID="ScriptManager1" runat="server">
20 </asp:ScriptManager>
21
22 <cc1:WebDock ID="WebDock1" runat="server" Height="664px" Width="839px" FitParent="FitWindow">
23 <MainContent>
24 <strong>Customized Update Panel</strong><br />
25 <br />
26 <span style="color: #006699">WebDockTabbedUpdatePanels</span><br />
27 <br />
28 A WebDockPanel can contain WebDockTabbedPanels and WebDockTabbedUpdatePanels. WebDockTabbedUpdatePanel
29 extends UpdatePanel in Microsoft ASP.NET AJAX.<br />
30 <br />
31 The WebDockPanel on the left contains two WebDockTabbedUpdatePanels (the <em>Folders</em>
32 and <em>Servers</em> tabbed panels). Content
33 within those tabbed panels could be refreshed individually without refreshing the entire
34 page.<br />
35 <br />
36 <br />
37 <span style="color: #006699">WebDockUpdatePanel</span><br />
38 <br />
39 A WebDockUpdatePanel is a WebDockPanel with UpdatePanel functionalities. It
40 is useful when you want to add/remove/re-arrange tabs in a postback, but don't want
41 to entire page to be refreshed.<br />
42 <br />
43 The dock panel at the bottom is a WebDockUpdatePanel. Click the button below
44 to add/remove a third 'Breakpoints' tab to the bottom dock panel.<br />
45 <asp:Button ID="btnToggle" runat="server" OnClick="btnToggle_Click" Text="Toggle" /><br />
46 <br />
47 <span style="color: #006699">Simple Postback</span><br />
48 <br />
49 A simple postback will cause the entire page to refresh, and result in flickering.<br />
50 <asp:Button ID="Button4" runat="server" Text="Simple Postback" asdf="2" />
51 </MainContent>
52 <TabStripProps ImagesFolderUrl="~/images/tabs" />
53 <Panels>
54 <cc1:WebDockPanel runat="server" PreferredSize="200" ActiveTabIndex="1" asdf="5">
55 <Tabs>
56 <cc1:WebDockTabbedUpdatePanel runat="server" ImageFileName="Folders.gif" Title="Folders"
57 UpdateMode="Conditional">
58 <Content>
59 <div style="background-color:#ffcccc">
60 Content of Folders<br />
61 <br />
62 This tabbed panel can be refreshed via AJAX postback.<br />
63 <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="AJAX Postback" />
64 <br />
65 <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
66 </div>
67 </Content>
68 </cc1:WebDockTabbedUpdatePanel>
69 <cc1:WebDockTabbedUpdatePanel runat="server" ImageFileName="Servers.gif" Title="Servers"
70 UpdateMode="Conditional">
71 <Content>
72 <div style="background-color:#ccffcc">
73 Content of Servers<br />
74 <br />
75 This tabbed panel can be refreshed via AJAX postback.<br />
76 <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="AJAX Postback" />
77 <br />
78 <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
79 </div>
80 </Content>
81 </cc1:WebDockTabbedUpdatePanel>
82 </Tabs>
83 </cc1:WebDockPanel>
84 <cc1:WebDockUpdatePanel runat="server" Dock="Bottom" PreferredSize="200" ID="BottomWebDockPanel" UpdateMode="Conditional">
85 <Tabs>
86 <cc1:WebDockTabbedPanel runat="server" ImageFileName="FindResults.gif" Title="Find Results">
87 <Content>
88 Content of Find Results
89 </Content>
90 </cc1:WebDockTabbedPanel>
91 <cc1:WebDockTabbedPanel runat="server" ImageFileName="Output.gif" Title="Output">
92 <Content>
93 Content of Output
94 </Content>
95 </cc1:WebDockTabbedPanel>
96 </Tabs>
97 <Triggers>
98 <cc1:ZCAsyncPostBackTrigger ControlID="btnToggle" EventName="click" />
99 </Triggers>
100 </cc1:WebDockUpdatePanel>
101 </Panels>
102 </cc1:WebDock>
103
104
105
106 </div>
107 </form>
108 </body>
109 </html>
110
1 using System;
2 using System.Data;
3 using System.Configuration;
4 using System.Collections;
5 using System.Web;
6 using System.Web.Security;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9 using System.Web.UI.WebControls.WebParts;
10 using System.Web.UI.HtmlControls;
11
12 using ZettaCube.ZeeControls;
13
14 namespace ZeeControls2Demo.WebDock.Advanced
15 {
16 public partial class UpdatePanel : System.Web.UI.Page
17 {
18 // Whether the Breakpoints tab should be shown is stored in viewstate
19 private bool ShowBreakpointsTab
20 {
21 get
22 {
23 if (ViewState["ShowBreakpointsTab"] != null)
24 {
25 return (ViewState["ShowBreakpointsTab"].ToString().ToLower() == "true");
26 }
27 else
28 {
29 return false;
30 }
31
32 }
33 set
34 {
35 ViewState["ShowBreakpointsTab"] = (value ? "true" : "false");
36 }
37
38 }
39
40 private bool BreakpointsTabCreated
41 {
42 get
43 {
44 return (BottomWebDockPanel.Tabs.Count >= 3);
45 }
46 }
47
48 protected void Page_Load(object sender, EventArgs e)
49 {
50 // Re-create Breakpoints tabbed panel if required
51 if (ShowBreakpointsTab)
52 {
53 CreateBreakpointsTab();
54 }
55
56 Label1.Text = "Last refreshed at " + System.DateTime.Now.ToLongTimeString();
57 Label2.Text = "Last refreshed at " + System.DateTime.Now.ToLongTimeString();
58 }
59
60 protected void Button1_Click(object sender, EventArgs e)
61 {
62 Label1.Text += "<br/>Above button clicked at " + System.DateTime.Now.ToLongTimeString();
63 }
64
65 protected void Button2_Click(object sender, EventArgs e)
66 {
67 Label2.Text += "<br/>Above button clicked at " + System.DateTime.Now.ToLongTimeString();
68 }
69
70 private void CreateBreakpointsTab()
71 {
72 if (!BreakpointsTabCreated)
73 {
74 // Create the Breakpoints tabbed panel
75 WebDockTabbedPanel breakpointsPanel = new WebDockTabbedPanel();
76 breakpointsPanel.Title = "Breakpoints";
77 breakpointsPanel.ImageFileName = "Breakpoints.gif";
78
79 // Add some content into the tabbed panel
80 Label l = new Label();
81 l.Text = "Here's the Breakpoints tabbed panel. Created at " + System.DateTime.Now.ToLongTimeString();
82 l.BackColor = System.Drawing.Color.FromArgb(0xcc, 0xcc, 0xff);
83 breakpointsPanel.Controls.Add(l);
84
85 // Add the tabbed panel to the parent WebDockUpdatePanel
86 BottomWebDockPanel.Tabs.Add(breakpointsPanel);
87 }
88 }
89
90 private void RemoveBreakpointsTab()
91 {
92 if (BreakpointsTabCreated)
93 {
94 BottomWebDockPanel.Tabs.RemoveAt(2);
95 }
96 }
97
98 protected void btnToggle_Click(object sender, EventArgs e)
99 {
100 ShowBreakpointsTab = !ShowBreakpointsTab;
101
102 if (ShowBreakpointsTab)
103 {
104 CreateBreakpointsTab();
105 BottomWebDockPanel.ActiveTabIndex = 2;
106 }
107 else
108 {
109 RemoveBreakpointsTab();
110 }
111 }
112 }
113 }
114
1 body
2 {
3 font-family: Tahoma, Geneva;
4 font-size: 10pt;
5 }
6
7 .ZCWDMainContent, .ZCWDPanelContent
8 {
9 padding: 3px;
10 }
11
12 .ZCWDPanelTitleBar
13 {
14 padding-left: 3px;
15 }
16
17 .ZCWSPanel
18 {
19 padding: 3px;
20 }
21
22 .title
23 {
24 display: block;
25 font-weight:bold;
26 line-height: 24px;
27 }
28
29 .indent
30 {
31 padding: 10px;
32 padding-left: 30px;
33 }
34
35 .blah
36 {
37 color: Gray;
38 }
39
40 .tableRowHeader
41 {
42 color: #666666;
43 }
44
45 .tableColumnHeader
46 {
47 color: #666666;
48 }
49
1 <%--
2 Default skin template. The following skins are provided as examples only.
3
4 1. Named control skin. The SkinId should be uniquely defined because
5 duplicate SkinId's per control type are not allowed in the same theme.
6
7 <asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >
8 <AlternatingRowStyle BackColor="Blue" />
9 </asp:GridView>
10
11 2. Default skin. The SkinId is not defined. Only one default
12 control skin per control type is allowed in the same theme.
13
14 <asp:Image runat="server" ImageUrl="~/images/image1.jpg" />
15 --%>