Behavior模型应用:可拖动的div容器
2008-02-22 21:58
453 查看
VS 2008
应用Asp.Net Ajax behavior模型,做了一个简单的可拖动的div ^_^
1. html页面
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0px;">
<form id="form1" runat="server">
<asp:ScriptManager ID="sMgr" runat="server">
<Scripts>
<asp:ScriptReference Path="~/Behaviors/DragBehavior.js" />
</Scripts>
</asp:ScriptManager>
<div id="divDrag" style="position:fixed; width:500px;height:200px;border:solid 1px #000000;">
<ul style="list-style:none; margin:0px; padding:0px;">
<li style="height:30px; background-color:#cccccc;"></li>
<li>
</li>
</ul>
</div>
</form>
<script type="text/javascript">
</script>
</body>
</html>
2. client behavior javascript library
Type.registerNamespace("Tristan");
Tristan.DragBehavior.registerClass('Tristan.DragBehavior', Sys.UI.Behavior);
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
应用Asp.Net Ajax behavior模型,做了一个简单的可拖动的div ^_^
1. html页面
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0px;">
<form id="form1" runat="server">
<asp:ScriptManager ID="sMgr" runat="server">
<Scripts>
<asp:ScriptReference Path="~/Behaviors/DragBehavior.js" />
</Scripts>
</asp:ScriptManager>
<div id="divDrag" style="position:fixed; width:500px;height:200px;border:solid 1px #000000;">
<ul style="list-style:none; margin:0px; padding:0px;">
<li style="height:30px; background-color:#cccccc;"></li>
<li>
</li>
</ul>
</div>
</form>
<script type="text/javascript">
</script>
</body>
</html>
2. client behavior javascript library
Type.registerNamespace("Tristan");
Tristan.DragBehavior.registerClass('Tristan.DragBehavior', Sys.UI.Behavior);
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
相关文章推荐
- Behavior模型应用:可拖动的div容器
- jquery的":focus"选择器,不适合应用在div容器上,更有ie6、7的支持问题
- 【※】非限定宽度横向滚动应用实例(DIV + CSS、鼠标拖动)
- 文字横向滚动应用实例(DIV + CSS、鼠标拖动)
- 微软WPF技术应用与实践系列(窗体与导航+容器+模型+数据绑定配多个应用案例)
- 文字纵向滚动应用实例(DIV + CSS、鼠标拖动)
- 鼠标拖动改变div容器的大小
- div容器中的图片拖动 俺的创作
- Qt容器类的对象模型及应用(线性结构篇)(好多图,比较清楚)
- jquery 拖动改变div 容器大小
- DIV 层拖动应用
- AJAX Extender模型 Behavior模型
- div+css之盒子模型
- 应用聚类模型获得聊天机器人语料
- 从div盒子模型谈如何写可维护的css代码
- 第九章三续:SIFT算法的应用--目标识别之Bag-of-words模型
- 在容器技术改造与应用上,美团云如何做到择善而从? - PaaS云
- 企业应用分层模型之讨论
- CSS盒子模型-盒子模型应用
- 兼容IE8、IE7、firefox、谷歌浏览器的可拖动DIV。