AJAX中DragPanelExtender扩展控件
页面代码:
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Panel ID="Panel1" runat="server" Height="170px" Width="242px">
<asp:Panel ID="Panel2" runat="server" Height ="18px">
<div style="background-image:url(image/AjaxMenuBg2.gif); background-repeat:repeat-x; color:White">我可以移动</div>
</asp:Panel>
<asp:TextBox ID="TextBox1" runat="server" Height="134px" Width="232px"></asp:TextBox></asp:Panel>
<cc1:DragPanelExtender ID="DragPanelExtender1" runat="server"
TargetControlID="Panel1"
DragHandleID="Panel2"
>
</cc1:DragPanelExtender>
</div>
<script type="text/javascript">
function setBodyHeightToContentHeight() {
document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)+"px";
}
setBodyHeightToContentHeight();
&nbs
相关文档:
<input type="button" onclick="ajaxTest()" value="AJAX测试">
<input type="button" onclick=" document.getElementById('weather').innerHTML='' " value="隐藏">
<mce:script type="text/javascript"><!--
// 1. 初始化 请求 对象
// Mozilla/Firefox 下的
//var xmlhttp = ne ......
其实ajax的东西不是很熟悉,而且对于javascript这样零碎的语言实在是很抗拒。于是过去一直都逃避它,迫于项目的压力,不得已惟有硬碰硬了。为了快速上手,之前做了几个小实验,代码实在太多了。幸好struts2提供了一些ajax的简易实现。
跟网上所有的教程一样,先从最简单的开始吧~
在头结点加上<s:head theme="ajax"/&g ......
jQuery学习笔记
提交form表单之后,不会刷新页面,而是局部刷新,欲提交的form只要有id即可
如果使用get请求,注意中文乱码问题,jquery会先使用iso8859-1解码,然后发给服务器,如果使用post请求,则直接将中文内容提交给服务器解析。
使用jquery-1.4.2.js和jquery.form.js插件。
如果创建新的js文件中,需要加上
doc ......
ajax Detail.aspx页面
protected void Page_Load(object sender, EventArgs e)
{
Thread.Sleep(500);
string Keyid = Request.QueryString["Id"].ToString();
......