Example of how to use Ajax control DragPanelExtender
With this code example, you can create a floating panel that you can move anywhere in the web page.
Code:
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Example of how to use Ajax control DragPanelExtender - MdmSoft</title>
<style>
.panel-container {
background-color: #fff;
border: 1px solid #808080;
height: 600px;
width: 700px;
}
.panel-note {
background-image: url(Images/post_it-blue.png);
color: #0094ff;
cursor: move;
font-family: 'Lucida Handwriting';
font-size: 12px;
height: 154px;
padding: 30px 10px;
text-align: center;
width: 176px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ToolkitScriptManager ID="tsmDragPanel" runat="server"></asp:ToolkitScriptManager>
<asp:DragPanelExtender ID="dpe" runat="server" TargetControlID="PanelNote"></asp:DragPanelExtender>
<asp:Panel ID="PanelNote" runat="server" CssClass="panel-note">
<asp:Label ID="LabelMessage" runat="server" Text="This panel is movable...<br />Try it!"></asp:Label>
</asp:Panel>
<asp:Panel ID="PanelContainer" runat="server" CssClass="panel-container"></asp:Panel>
</div>
</form>
</body>
</html>
Result:
If our work has been of help, you can help us with a small donation...
Our programmers will thank you!
Related code snippets posted in
Ajax:
The best
Ajax
recommended books:
All information contained in this web site are the property of MdmSoft.
The information is provided "as is", MdmSoft will not be liable for any misuse of the code contained in these pages,
nor can it be for inaccuracies, grammatical errors or other factors that may have caused damage or lost earnings.
MdmSoft is not responsible for the content of comments posted by users.
The examples in this area have the educational and demonstration purposes only,
and may be copied only for your reference, but cannot be used for commercial purposes,
or for any other purpose, without the express written consent of MdmSoft.
MdmSoft also reserves the right to change, without notice, to your liking this web site,
the pages and its sections, and may suspend temporarily or definitely the various services included on this site.
While using this site, you agree to have read and accepted our Terms of Service and Privacy Policy.