1、dropdownlist 要是想要具有鼠标悬浮,具有提示的效果,可以添加其title属性,具体代码如下:
private void GetCheckStateAndFillDT(string flag, DropDownList ddlCheck)
{
string sql = "select * from db_xtwh.t_dm_nssbjk_hsqkdm where FLAG='1' and SSDL in(" + flag + ")";
DataTable dt = CommonBLL.getResult(sql);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
ListItem li = new ListItem();
li.Text = dt.Rows[i]["HSQK"].ToString();
li.Attributes.Add("title",li.Text);
li.Value = dt.Rows[i]["ZZDM"].ToString();
ddlCheck.Items.Add(li);
}
}
}
{
string sql = "select * from db_xtwh.t_dm_nssbjk_hsqkdm where FLAG='1' and SSDL in(" + flag + ")";
DataTable dt = CommonBLL.getResult(sql);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
ListItem li = new ListItem();
li.Text = dt.Rows[i]["HSQK"].ToString();
li.Attributes.Add("title",li.Text);
li.Value = dt.Rows[i]["ZZDM"].ToString();
ddlCheck.Items.Add(li);
}
}
}
2、如果要隐藏多个tr,可以使用下面方法:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JQuery隐藏多个tr标签</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tr1").each(function(i){
$(this).css("display","none");
});
})
</script>
</head>
<body>
<table>
<tr id="tr1">
<td>11111111111111111</td>
<td>222222222222222</td></tr>
<tr id="tr1">
<td>3333333333333333</td>
<td>44444444444444444</td></tr>
<tr id="tr2">
<td>555555555555555</td>
<td>6666666666666666666</td></tr>
<tr id="tr3">
<td>77777777777777777</td>
<td>88888888888888</td></tr>
</table>
</body>
</html>
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JQuery隐藏多个tr标签</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tr1").each(function(i){
$(this).css("display","none");
});
})
</script>
</head>
<body>
<table>
<tr id="tr1">
<td>11111111111111111</td>
<td>222222222222222</td></tr>
<tr id="tr1">
<td>3333333333333333</td>
<td>44444444444444444</td></tr>
<tr id="tr2">
<td>555555555555555</td>
<td>6666666666666666666</td></tr>
<tr id="tr3">
<td>77777777777777777</td>
<td>88888888888888</td></tr>
</table>
</body>
</html>