代码如下:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NetSysMonitor3.aspx.cs" Inherits="NetSysMonitor3" %><!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 id="Head1" runat="server">
<title> </title>
<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="style/Right.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
//动画速度
var speed = 500; //绑定事件处理
$("#btnShow").click(function (event) {
//取消事件冒泡
event.stopPropagation();
//设置弹出层位置
var offset = $(event.target).offset();
$("#divPop").css({ top: offset.top + $(event.target).height() + "px", left: offset.left });
//切换弹出层的显示状态
$("#divPop").toggle(speed); });
});
</script>
</head>
<body onload="show()">
<form id="form1" runat="server">
<div class="content">
<div class="right">
<div class="rightBottom" style="overflow: scroll;">
<asp:DataList ID="DataList1" runat="server" Height="205px" RepeatColumns="3" RepeatDirection="Horizontal"
Style="margin-right: 0px" Width="100%" OnItemCommand="DataList1_ItemCommand"
DataKeyField="WSID" OnItemDataBound="DataList1_ItemDataBound">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<span style="font-size: 16px; font-weight: bold;">
<%#Eval("WSName")%></span><br />
<hr />
<span style="background-color: White;">楼 层 : </span>
<%#Eval("FloorName")%><br />
<hr />
<span style="background-color: White;">所在IP地址 :</span>
<%#Eval("IPADDR")%>
<asp:LinkButton ID="btnShow" runat="server" CommandName="select">查看详细</asp:LinkButton>
<br />
<hr />
<!-- 弹出层 -->
<div id="divPop" style="background-color: #f0f0f0; border: solid 1px #000000; position: absolute;
display: none; width: 300px; height: 100px;">
<div id="Div1" style="text-align: center;" runat="server">
弹出层
<asp:GridView ID="GridView2" runat="server">
</asp:GridView>
</div>
</div>
<%-- <asp:GridView ID="GridView2" runat="server">
</asp:GridView>--%>
<br />
<hr />
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:DataList>
</div>
</div>
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title> </title>
<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
<link href="style/Right.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
//动画速度
var speed = 500; //绑定事件处理
$("#btnShow").click(function (event) {
//取消事件冒泡
event.stopPropagation();
//设置弹出层位置
var offset = $(event.target).offset();
$("#divPop").css({ top: offset.top + $(event.target).height() + "px", left: offset.left });
//切换弹出层的显示状态
$("#divPop").toggle(speed); });
});
</script>
</head>
<body onload="show()">
<form id="form1" runat="server">
<div class="content">
<div class="right">
<div class="rightBottom" style="overflow: scroll;">
<asp:DataList ID="DataList1" runat="server" Height="205px" RepeatColumns="3" RepeatDirection="Horizontal"
Style="margin-right: 0px" Width="100%" OnItemCommand="DataList1_ItemCommand"
DataKeyField="WSID" OnItemDataBound="DataList1_ItemDataBound">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<span style="font-size: 16px; font-weight: bold;">
<%#Eval("WSName")%></span><br />
<hr />
<span style="background-color: White;">楼 层 : </span>
<%#Eval("FloorName")%><br />
<hr />
<span style="background-color: White;">所在IP地址 :</span>
<%#Eval("IPADDR")%>
<asp:LinkButton ID="btnShow" runat="server" CommandName="select">查看详细</asp:LinkButton>
<br />
<hr />
<!-- 弹出层 -->
<div id="divPop" style="background-color: #f0f0f0; border: solid 1px #000000; position: absolute;
display: none; width: 300px; height: 100px;">
<div id="Div1" style="text-align: center;" runat="server">
弹出层
<asp:GridView ID="GridView2" runat="server">
</asp:GridView>
</div>
</div>
<%-- <asp:GridView ID="GridView2" runat="server">
</asp:GridView>--%>
<br />
<hr />
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:DataList>
</div>
</div>
</div>
</form>
</body>
</html>
解决方案 »
- 不用FileUpload控件实现文件的上传
- 新手问题,ExecuteScalar(),百思不得其解
- 取GridView数据值
- 高分求在asp网页中引用asp.net网页的方法
- [求助]asp.net 连接oracle问题 菜鸟问题
- 用asp中的Fileupload控件怎么实现百度文库的那种上传效果啊?
- 100分求解Nhibernate 真正运用到项目开发的有多少??进者有分!
- 用DataGrid显示记录,但分页写在存储过程里面,在程序里调用。这样的源码哪里有啊??
- 为什么在运行后DATAGRID中没有数据呢?
- 同时上传多个文件
- 高手帮忙给看看,抓取Google的搜索结果,出现如下错误!
- MVC下如何在controller中查询多张表,并将结果传给view?
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<input type="button" name="Submit" value="点击这里下面显示" onclick="qq.style.display='block'">
<input type="button" name="Submit2" value="点击这里下面隐藏" onclick="qq.style.display='none'">
<div id="qq">
<table width="492" height="302" border="0" cellpadding="1" cellspacing="1">
<tr>
<td width="488" bgcolor="#3366FF">内容,这个表格是嵌套在id是"qq"的DIV中的</td>
</tr>
</table>
</div>
</body>
</html>
http://dotnet.aspx.cc/article/d94323a7-e322-4ead-9f25-6e6629c8012e/read.aspx另外,你要知道,你的客户端不只是一个《div id=divPop>你可以打开浏览器源代码查看,id不是重复的,。你要搞清楚啊另外,你的点击是在服务器事件处理的吧?
这样写是完全错误的 除非你的datalist只有一条数据
<asp:DataList ID="dl_action" runat="server" Font-Size="12px" Width="242px" DataKeyField="intDeviceId">
<ItemTemplate>
<div id="DIV" style="width: 83px; padding-right: 0px; float: right" runat="server"> <asp:Label ID="lbl_time" runat="server" Text="时间"></asp:Label> </div> </ItemTemplate> </asp:DataList>
隐藏层 后台DIV.style["display"]="none"