关于margin-top的高度在不同浏览器下高度不等,不考虑IE8的问题,
在布局时首先考虑在FireFox下正常,然后调试IE6、IE7
直接上代码
margin-top: 70px; /* firefox */
*margin-top: 63px; /* IE7*/
_margin-top: 63px; /* IE6 */

开发环境VS2008,新建网站网站,添加启用Ajax的wcf服务如下图

打开App_Code下的CS文件,添加如下方法

在浏览器中运行新增的AjaxService.svc如下图

在浏览器地址栏中加上/js 继续运行得到一个js文件包存到网站中,
在页面中添加
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/WcfService/AjaxWcf.js" />
</Scripts>
</asp:ScriptManager>
调用方法一
javascript调用
window.onlaod=function(){
AjaxService.Getvalue("东明", "21", onSuccess);
}
function onSuccess(res) {
alert(res);
}
调用方法二
jquery调用
$.ajax({
type: 'POST',
url: 'WcfService/AjaxService.svc/GetString',
contentType: 'text/json',
data: '',
success: function(result) {
alert(result.d);
}
});
$.ajax({
type: 'post',
contentType: 'text/json',
url: 'WcfService/AjaxService.svc/Getvalue',
data: '{"name":"小明","age":"10"}',
success: function(result) {
alert(result.d);
}
});
调用成功!.....


<!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></title>
<script src="jquery-1.3.1.js" type="text/javascript"></script>
<script type="text/javascript">
var TabMenu = function() {
var index = 0;
$("ul>li").each(function(i) {
var thisClass = $(this).attr("class");
$(this).mouseover(function() {
if (index != i) {
$("ul>li").removeClass("MouseOutStyle");
$(this).addClass("MouseoverStyle");
}
else {
$(this).addClass("ClickStyle");
}
}).mouseout(function() {
if (index != i) {
$("ul>li").removeClass("MouseoverStyle");
$(this).addClass("MouseOutStyle");
}
else {
$(this).addClass("ClickStyle");
}
}).click(function() {
$("ul>li").removeClass("MouseOutStyle");
$("ul>li").removeClass("MouseoverStyle");
$("ul>li").removeClass("ClickStyle");
$(this).addClass("ClickStyle");
index = i;
});
})
}
$(function() {
TabMenu();
});
</script>
<style type="text/css">
body
{
color: Black;
}
ul
{
list-style-type: none;
border: 0px;
height: 30px;
_height: 30px;
margin-left: 0px !important;
margin-top: 0px;
padding-left: 0px;
}
ul li
{
list-style-type: none;
float: left;
width: 134px;
height: 30px;
_height: 30px;
line-height: 30px;
background: url(blue.png);
background-position: 848px 122px;
margin-left: 1px;
text-align: center;
}
ul li:hover
{
cursor: pointer;
}
.ClickStyle
{
width: 134px;
height: 30px;
_height: 30px;
line-height: 30px;
background: url(blue.png);
background-position: 848px 61px;
margin-left: 1px;
text-align: center;
color: White;
}
.MouseoverStyle
{
width: 134px;
height: 30px;
_height: 30px;
line-height: 30px;
background: url(blue.png);
background-position: 848px 0px;
margin-left: 1px;
text-align: center;
color: White;
}
.MouseOutStyle
{
width: 134px;
height: 30px;
_height: 30px;
line-height: 30px;
background: url(blue.png);
background-position: 848px 122px;
margin-left: 1px;
text-align: center;
color: Black;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="float: left; width: 500px; border: 0px red solid;">
<div style="float: left; width: 100%; height: 30px; _height: 30px
border: 1px blue solid;">
<ul>
<li class="ClickStyle">menu1</li>
<li>menu1</li>
<li>menu1</li>
</ul>
</div>
<div style="float: left; width: 100%; height: 300px; border: 1px #818181 solid;">
</div>
</div>
</form>
</body>
</html>
Begin Transaction TranDocumentControl_Insert 开始事务
Insert Into table valuies () //执行动作
If @@Error<>0
Goto EndProc //如果执行结果@@Error错误记录不等于0,则表示动作执行出错,那么接着执行 endproc程序段
else
Commit Transaction TranDocumentControl_Insert //如果执行结果等于0,表示动作执行成功,则提交事务
Return 0
EndProc:
RollBack Transaction TranDocumentControl_Insert //在这里回滚事务
Return 1
转载于http://blog.csdn.net/hzjsoft2003/article/details/6186853
region 得到所有本地网络中可使用的SQL服务器列表
/// <summary>
/// 得到所有本地网络中可使用的SQL服务器列表
/// </summary>
/// <param name= "p_strServerList "> 服务器列表 </param>
/// <returns> </returns>
public static bool GetServers(ref string [] p_strServerList)
{
try
{
SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass();
SQLDMO.NameList sqlServers = sqlApp.ListAvailableSQLServers();
if(sqlServers.Count > 0)
{
p_strServerList = new string[sqlServers.Count];
for(int i=0;i <sqlServers.Count;i++)
{
string srv = sqlServers.Item(i + 1);
if(srv != null)
{
p_strServerList[i] = srv;
}
}
}
return true;
}
catch(Exception ex)
{
throw ex;
}
}
#endregion
#region 得到指定SQL服务器所有数据库的列表
/// <summary>
/// 得到指定SQL服务器所有数据库的列表
/// </summary>
/// <param name= "p_strDataBaseList "> 数据库列表 </param>
/// <param name= "p_strServer "> 服务器名 </param>
/// <param name= "p_strUser "> 用户名 </param>
/// <param name= "p_strPWD "> 密码 </param>
/// <returns> </returns>
public static bool GetDataBases(ref string [] p_strDataBaseList, string p_strServer, string p_strUser, string p_strPWD)
{
try
{
int i = 0;
SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass();
SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();
srv.Connect(p_strServer,p_strUser,p_strPWD);
if(srv.Databases.Count > 0)
{
p_strDataBaseList = new string[srv.Databases.Count];
foreach(SQLDMO.Database db in srv.Databases)
{
if(db.Name!=null)
{
p_strDataBaseList[i] = db.Name;
}
i = i + 1;
}
}
return true;
}
catch(Exception ex)
{
throw ex;
}
}
#endregion
#region 得到所有的存储过程
/// <summary>
/// 得到所有的存储过程
/// </summary>
/// <param name= "p_strProcedureList "> 存储过程列表 </param>
/// <param name= "p_strServer "> 服务器名 </param>
/// <param name= "p_strUser "> 用户名 </param>
/// <param name= "p_strPWD "> 密码 </param>
/// <param name= "p_strDataBase "> 数据库名 </param>
/// <returns> </returns>
public static bool GetProcedures(ref string [] p_strProcedureList, string p_strServer, string p_strUser, string p_strPWD, string p_strDataBase)
{
try
{
SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();
srv.Connect(p_strServer,p_strUser,p_strPWD);
for(int i=0;i <srv.Databases.Count;i++)
{
if(srv.Databases.Item(i+1, "dbo ").Name == p_strDataBase)
{
SQLDMO._Database db= srv.Databases.Item(i+1, "dbo ");
if (db.StoredProcedures.Count > 0)
{
p_strProcedureList = new string[db.StoredProcedures.Count];
for(int j=0;j <db.StoredProcedures.Count;j++)
{
p_strProcedureList[j] = db.StoredProcedures.Item(j+1, "dbo ").Name;
}
break;
}
}
}
return true;
}
catch(Exception ex)
{
throw ex;
}
}
#endregion
#region 得到所有的Tables集合
/// <summary>
/// 得到所有的Tables集合
/// </summary>
/// <param name= "p_strProcedureList "> Tables集合 </param>
/// <param name= "p_strServer "> 服务器名 </param>
/// <param name= "p_strUser "> 用户名 </param>
/// <param name= "p_strPWD "> 密码 </param>
/// <param name= "p_strDataBase "> 数据库名 </param>
/// <returns> </returns>
public static bool GetTables(ref string [] p_strTableList, string p_strServer, string p_strUser, string p_strPWD, string p_strDataBase)
{
try
{
SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();
srv.Connect(p_strServer,p_strUser,p_strPWD);
for(int i=0;i <srv.Databases.Count;i++)
{
if(srv.Databases.Item(i+1, "dbo ").Name == p_strDataBase)
{
SQLDMO._Database db= srv.Databases.Item(i+1, "dbo ");
if (db.Tables.Count > 0)
{
p_strTableList = new string[db.Tables.Count];
for(int j=0;j <db.Tables.Count;j++)
{
p_strTableList[j] = db.Tables.Item(j+1, "dbo ").Name;
}
break;
}
}
}
return true;
}
catch(Exception ex)
{
throw ex;
}
}
#endregion
#region 得到所有的Views集合
/// <summary>
/// 得到所有的Views集合
/// </summary>
/// <param name= "p_strProcedureList "> Views集合 </param>
/// <param name= "p_strServer "> 服务器名 </param>
/// <param name= "p_strUser "> 用户名 </param>
/// <param name= "p_strPWD "> 密码 </param>
/// <param name= "p_strDataBase "> 数据库名 </param>
/// <returns> </returns>
public static bool GetViews(ref string [] p_strViewList, string p_strServer, string p_strUser, string p_strPWD, string p_strDataBase)
{
try
{
SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass();
srv.Connect(p_strServer,p_strUser,p_strPWD);
for(int i=0;i <srv.Databases.Count;i++)
{
if(srv.Databases.Item(i+1, "dbo ").Name == p_strDataBase)
{
SQLDMO._Database db= srv.Databases.Item(i+1, "dbo ");
if (db.Views.Count > 0)
{
p_strViewList = new string[db.Views.Count];
for(int j=0;j <db.Views.Count;j++)
{
p_strViewList[j] = db.Views.Item(j+1, "dbo ").Name;
}
break;
}
}
}
return true;
}
catch(Exception ex)
{
throw ex;
}
}
#endregion
一 javascript正则表达式的基本知识
1 javascript 正则对象创建 和用法
声明javascript 正则表达式
var reCat = new RegExp("cat");
你也可以
var reCat = /cat/; //Perl 风格 (推荐)
2 学习最常用的 test exec match search replace split 6个方法
1) test 检查指定的字符串是否存在
var data = "123123";
var reCat = /123/gi;
alert(reCat.test(data)); //true
//检查字符是否存在 g 继续往下走 i 不区分大小写
2) exec 返回查询值
var data = "123123,213,12312,312,3,Cat,cat,dsfsdfs,";
var reCat = /cat/i;
alert(reCat.exec(data)); //Cat
3)match 得到查询数组
var data = "123123,213,12312,312,3,Cat,cat,dsfsdfs,";
var reCat = /cat/gi;
var arrMactches = data.match(reCat)
for (var i=0;i < arrMactches.length ; i++)
{
alert(arrMactches[i]); //Cat cat
}
4) search 返回搜索位置 类似于indexof
var data = "123123,213,12312,312,3,Cat,cat,dsfsdfs,";
var reCat = /cat/gi;
alert(data.search(reCat)); //23
5) replace 替换字符 利用正则替换
var data = "123123,213,12312,312,3,Cat,cat,dsfsdfs,";
var reCat = /cat/gi;
alert(data.replace(reCat,"libinqq"));
6)split 利用正则分割数组
var data = "123123,213,12312,312,3,Cat,cat,dsfsdfs,";
var reCat = /\,/;
var arrdata = data.split(reCat);
for (var i = 0; i < arrdata.length; i++)
{
alert(arrdata[i]);
}
