Panel 最大高度


  1. <%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="AJAXEnabledWebApplication9._Default" %>
  2. <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5.     <title>Untitled Pagetitle>
  6.     <style type="text/css">
  7.     #Panel1 {
  8.   max-width:220px;
  9.   max-height:50px;
  10.   overflow:auto;
  11.     }
  12.     style>
  13. head>
  14. <body>
  15.     <form id="form1" runat="server">
  16.         <asp:ScriptManager ID="ScriptManager1" runat="server" />
  17.         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  18.             <ContentTemplate>
  19.                 <asp:Panel ID="Panel2" runat="server" style="display: none; " HorizontalAlign="Center" BorderColor="Red" BorderWidth="1px">
  20.                     <asp:Panel ID="Panel1" runat="server" BackColor="#FFFFC0" Style="width: 200px"
  21.                         HorizontalAlign="Center">
  22.                         <asp:Label ID="Label1" runat="server" Text="Label">asp:Label>
  23.                         <br />
  24.                     asp:Panel>
  25.                     <asp:Button ID="Button3" runat="server" Text="OK" />
  26.                 asp:Panel>
  27.                 <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="One Line" /> 
  28.                 <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Multi Line" />
  29.                 <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel2"
  30.                     TargetControlID="Button4">
  31.                 cc1:ModalPopupExtender>
  32.                 <asp:Button ID="Button4" runat="server" Style="display: none" Text="Button" />
  33.             ContentTemplate>
  34.         asp:UpdatePanel>
  35.     form>
  36. body>
  37. 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.         }

你可能感兴趣的:(C#)