AjaxControlToolkit 微软出的ajax.net 工具使用教程九 DragPanelExtender(拖拉)控件的使用 (游陆原创)

新建一个AjaxControlToolkitWebSite 项目,把下面的代码复制到你的页面:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <link href="StyleSheet.css" _fcksavedurl=""StyleSheet.css"" rel="stylesheet" type="text/css" />   
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
            <ajaxToolkit:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID="PanelContainer" DragHandleID="PanelHeader">
            </ajaxToolkit:DragPanelExtender>
            <asp:Panel ID="PanelContainer" runat="server" CssClass="dragContainer" >
                <asp:Panel ID="PanelHeader" runat="server" CssClass="dragHeader">
                  <br />Header</asp:Panel>
                <asp:Panel ID="PanelBody" runat="server" CssClass="dragBody">
                    <br />
                    One<br /><br />
                    Two<br /><br />
                    Three<br /><br />
                    Four
                 </asp:Panel>
                 </asp:Panel>
           </div>
    </form>
   
    <script type="text/javascript">
    function setBodyHeightToContentHeight() {
        document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)+"px";
    }
    setBodyHeightToContentHeight();
    window.attachEvent('onresize', setBodyHeightToContentHeight);
    </script>   
</body>
</html> 

 

你可能感兴趣的:(server,XHTML,asp,工具,微软,stylesheet)