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
相关文档:
<script language="javascript" type="text/javascript">
function doubleSalary()
{
var employee = new Object();
employee.FirstName = "X";
employee.LastName = "PP";
employee.Salary = 1000;
......
其实ajax的东西不是很熟悉,而且对于javascript这样零碎的语言实在是很抗拒。于是过去一直都逃避它,迫于项目的压力,不得已惟有硬碰硬了。为了快速上手,之前做了几个小实验,代码实在太多了。幸好struts2提供了一些ajax的简易实现。
跟网上所有的教程一样,先从最简单的开始吧~
在头结点加上<s:head theme="ajax"/&g ......
用Ajax实现Tab效果的
先创建
ajax.php,在其中输入如下代码:
<!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>
<title>Sample 2_1</title>
<me ......
如上图所示的等级控件(这个控件主要指定样式):
页面代码:
<head runat="server">
<title>无标题页</title>
<mce:style type ="text/css"><!--
.ratingStar
{
font-size:0pt;
width:15px;
height:12px;
......
/*在有中文参数时,接收方需要使用UTF-8方式对数据进行解码
*不支持post附件
*/
function getXmlHttpRequest() {
var xmlHttpRequest = null;
try {
xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} ......