Panel 最大高度

来源:互联网 发布:匡威淘宝 编辑:程序博客网 时间:2024/04/29 22:53

  1. <%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="AJAXEnabledWebApplication9._Default" %>
  2. <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6.     <title>Untitled Page</title>
  7.     <style type="text/css">
  8.     #Panel1 {
  9.   max-width:220px;
  10.   max-height:50px;
  11.   overflow:auto;
  12.     }
  13.     </style>
  14. </head>
  15. <body>
  16.     <form id="form1" runat="server">
  17.         <asp:ScriptManager ID="ScriptManager1" runat="server" />
  18.         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  19.             <ContentTemplate>
  20.                 <asp:Panel ID="Panel2" runat="server" style="display: none; " HorizontalAlign="Center" BorderColor="Red" BorderWidth="1px">
  21.                     <asp:Panel ID="Panel1" runat="server" BackColor="#FFFFC0" Style="width: 200px"
  22.                         HorizontalAlign="Center">
  23.                         <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
  24.                         <br />
  25.                     </asp:Panel>
  26.                     <asp:Button ID="Button3" runat="server" Text="OK" />
  27.                 </asp:Panel>
  28.                 <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="One Line" /> 
  29.                 <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Multi Line" />
  30.                 <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel2"
  31.                     TargetControlID="Button4">
  32.                 </cc1:ModalPopupExtender>
  33.                 <asp:Button ID="Button4" runat="server" Style="display: none" Text="Button" />
  34.             </ContentTemplate>
  35.         </asp:UpdatePanel>
  36.     </form>
  37. </body>
  38. </html>
  1. protected void Button1_Click(object sender, EventArgs e)
  2.         {
  3.             this.Label1.Text = "测试";
  4.             this.ModalPopupExtender1.Show();
  5.         }
  6.         protected void Button2_Click(object sender, EventArgs e)
  7.         {
  8.             this.Label1.Text = "The output should be a VS 2008 project and source that meets the above requirements.  The code should be written in C# and make use of .Net 3.5 technologies including WPF.";
  9.             this.ModalPopupExtender1.Show();
  10.         }
原创粉丝点击