default.aspx
<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" 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>无标题页</title>
<style>
ul,li {
list-style:none;
margin-left: 1px;
margin-bottom:0;
padding: 0;
border: 0;
list-style-type: none;
list-style-image: none;
}
.show {
z-index:99;
font-size:12px;
border:1px outset;
}
.show span {
float:right;
}
.show div {
width:100%;
height:100%;
}
.show div ul li span {
float:right;
}
.show div ul li {
text-align:left;
color:red;
width:100%;
cursor:default;
}
.blue {
background:#0A246A;color:#ffffff;text-decoration:none;
}
.white {
background:#ffffff;
}
</style>
<script type="text/javascript">
function CPos(x, y)
{
this.x = x;
this.y = y;
}
//获取控件的位置
function GetObjPos(ATarget)
{
var target = ATarget;
var pos = new CPos(target.offsetLeft, target.offsetTop);
var target = target.offsetParent;
while (target)
{
pos.x += target.offsetLeft;
pos.y += target.offsetTop;
target = target.offsetParent
}
return pos;
}
function showdivtxt(txtobj){
showtxt.style.width=txtobj.offsetWidth;
var p = GetObjPos(txtobj);
showtxt.style.left=p.x;
showtxt.style.top=p.y+txtobj.offsetHeight;
if(txtobj.value.replace(/(\s*$)/g, "")!=""){
//异步取数据
var ds = _Default.SearchTxt(txtobj.value).value;
var s;
if (ds.Tables[0].Rows.length>0){
s="<ul>";
showtxt.style.display=''block'';
for(var i=0;i<ds.Tables[0].Rows.length;i++){
s+="<li class=''white'' onclick=\"<%=this.tb_search.ClientID %>.value=''"+ds.Tables[0].Rows[i]["tagword"]+"'';showtxt.style.display=''none'';\" onmouseout=''changebgw(this);'' onmouseover=''changebgb(this);''><span style=''color:green;''>"+ds.Tables[0]. |