本人用 iframe 做了一个tab页.代码如下:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="budgetList.aspx.cs" Inherits="Report_budgetList" %><html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>项目立项列表</title>
<link rel="stylesheet" href="../css/css.css" type="text/css" /> <script language="javascript" type="text/javascript" src="../js/jscontrol.js"></script> <style type="text/css">
body
{
overflow: hidden;
}
.tdClass
{
border-left: 1px solid #BCD2E6;
border-right: 1px solid #BCD2E6;
border-top: 1px solid #BCD2E6;
border-bottom: 1px solid #BCD2E6;
cursor: pointer;
}
</style> <script type="text/javascript">
function setTdBackGroundColor(tdColor1,tdColor2,tdColor3){
document.getElementById("tdproBudgetProList").style.backgroundColor=tdColor1;
document.getElementById("tdproBudgetProChangeList").style.backgroundColor=tdColor2;
document.getElementById("tdbudgetExecStatusReportDetails").style.backgroundColor=tdColor3;
}
function SelectElement(tdElement)
{
tdElement.style.backgroundColor="";
var passUrl="budgetExecStatusQuery.aspx";
switch(tdElement.id.toString()){ //设着色
case "tdproBudgetProList":
setTdBackGroundColor("#ffffff","#cae8f8","#cae8f8");
break;
case "tdproBudgetProChangeList":
setTdBackGroundColor("#cae8f8","#ffffff","#cae8f8");
break;
case "tdbudgetExecStatusReportDetails":
setTdBackGroundColor("#cae8f8","#cae8f8","#ffffff");
break;
}
var spanElement=tdElement.getElementsByTagName("span");
if(spanElement!=null){ //设url
switch(spanElement[0].id.toString()){
case "lblproBudgetProList":
passUrl="budgetExecStatusQuery.aspx";
break;
case "lblproBudgetProChangeList":
passUrl="budgetExecStatusReport.aspx";
break;
case "lblbudgetExecStatusReportDetails":
passUrl="budgetExecStatusReportDetails.aspx";
break;
}
}
document.getElementById("frameAuditMain").src=passUrl;
}
function onLoad(){
document.getElementById("frameAuditMain").src="budgetExecStatusQuery.aspx";
}
</script></head>
<body onload="onLoad();">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="height: 100%;
width: 100%;">
<tr class="siteMap">
<td>
<img alt="" src="../images/icon.gif" />
当前位置:
<asp:SiteMapPath ID="SiteMapPath1" runat="server" PathSeparator=" >>">
</asp:SiteMapPath>
</td>
</tr>
<tr style="height: 21px;">
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;">
<tr>
<td id="tdproBudgetProList" onclick="SelectElement(this);" class="tdClass" style="width: 100px;"
align="center">
<asp:Label ID="lblproBudgetProList" runat="server" Style="color: #003755;" Text="预算执行情况查询"></asp:Label>
</td>
<td id="tdproBudgetProChangeList" onclick="SelectElement(this);" class="tdClass"
align="center" style="background-color: #cae8f8; width: 120px;">
<asp:Label ID="lblproBudgetProChangeList" runat="server" Style="color: #003755;"
Text="预算执行情况统计表"></asp:Label>
</td>
<td id="tdbudgetExecStatusReportDetails" onclick="SelectElement(this);" class="tdClass"
align="center" style="background-color: #cae8f8; width: 100px;">
<asp:Label ID="lblbudgetExecStatusReportDetails" runat="server" Style="color: #003755;"
Text="预算执行情况明细"></asp:Label>
</td>
<td style="border-bottom: 1px solid #d3d3d3;">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 100%;">
<iframe id="frameAuditMain" runat="server" frameborder="0" height="100%" width="100%"
scrolling="auto" src=""></iframe>
</td>
</tr>
</table>
</form>
</body>
</html>问题如下:我在budgetExecStatusReport.aspx页里怎么获取到通 budgetList.aspx 页面里的 某个ID,比如说:tdbudgetExecStatusReportDetails?
<head id="Head1" runat="server">
<title>项目立项列表</title>
<link rel="stylesheet" href="../css/css.css" type="text/css" /> <script language="javascript" type="text/javascript" src="../js/jscontrol.js"></script> <style type="text/css">
body
{
overflow: hidden;
}
.tdClass
{
border-left: 1px solid #BCD2E6;
border-right: 1px solid #BCD2E6;
border-top: 1px solid #BCD2E6;
border-bottom: 1px solid #BCD2E6;
cursor: pointer;
}
</style> <script type="text/javascript">
function setTdBackGroundColor(tdColor1,tdColor2,tdColor3){
document.getElementById("tdproBudgetProList").style.backgroundColor=tdColor1;
document.getElementById("tdproBudgetProChangeList").style.backgroundColor=tdColor2;
document.getElementById("tdbudgetExecStatusReportDetails").style.backgroundColor=tdColor3;
}
function SelectElement(tdElement)
{
tdElement.style.backgroundColor="";
var passUrl="budgetExecStatusQuery.aspx";
switch(tdElement.id.toString()){ //设着色
case "tdproBudgetProList":
setTdBackGroundColor("#ffffff","#cae8f8","#cae8f8");
break;
case "tdproBudgetProChangeList":
setTdBackGroundColor("#cae8f8","#ffffff","#cae8f8");
break;
case "tdbudgetExecStatusReportDetails":
setTdBackGroundColor("#cae8f8","#cae8f8","#ffffff");
break;
}
var spanElement=tdElement.getElementsByTagName("span");
if(spanElement!=null){ //设url
switch(spanElement[0].id.toString()){
case "lblproBudgetProList":
passUrl="budgetExecStatusQuery.aspx";
break;
case "lblproBudgetProChangeList":
passUrl="budgetExecStatusReport.aspx";
break;
case "lblbudgetExecStatusReportDetails":
passUrl="budgetExecStatusReportDetails.aspx";
break;
}
}
document.getElementById("frameAuditMain").src=passUrl;
}
function onLoad(){
document.getElementById("frameAuditMain").src="budgetExecStatusQuery.aspx";
}
</script></head>
<body onload="onLoad();">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="height: 100%;
width: 100%;">
<tr class="siteMap">
<td>
<img alt="" src="../images/icon.gif" />
当前位置:
<asp:SiteMapPath ID="SiteMapPath1" runat="server" PathSeparator=" >>">
</asp:SiteMapPath>
</td>
</tr>
<tr style="height: 21px;">
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" style="height: 100%; width: 100%;">
<tr>
<td id="tdproBudgetProList" onclick="SelectElement(this);" class="tdClass" style="width: 100px;"
align="center">
<asp:Label ID="lblproBudgetProList" runat="server" Style="color: #003755;" Text="预算执行情况查询"></asp:Label>
</td>
<td id="tdproBudgetProChangeList" onclick="SelectElement(this);" class="tdClass"
align="center" style="background-color: #cae8f8; width: 120px;">
<asp:Label ID="lblproBudgetProChangeList" runat="server" Style="color: #003755;"
Text="预算执行情况统计表"></asp:Label>
</td>
<td id="tdbudgetExecStatusReportDetails" onclick="SelectElement(this);" class="tdClass"
align="center" style="background-color: #cae8f8; width: 100px;">
<asp:Label ID="lblbudgetExecStatusReportDetails" runat="server" Style="color: #003755;"
Text="预算执行情况明细"></asp:Label>
</td>
<td style="border-bottom: 1px solid #d3d3d3;">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 100%;">
<iframe id="frameAuditMain" runat="server" frameborder="0" height="100%" width="100%"
scrolling="auto" src=""></iframe>
</td>
</tr>
</table>
</form>
</body>
</html>问题如下:我在budgetExecStatusReport.aspx页里怎么获取到通 budgetList.aspx 页面里的 某个ID,比如说:tdbudgetExecStatusReportDetails?
解决方案 »
- 修改web.config,iis都做了哪些操作?
- asp.net生成GridView 空白行,有谁做过急!!
- GridView编辑按钮问题。
- 來者接分,怎么樣繼承或include一個頁面的CSS、JS(在線等,急!!!)
- System.InvalidOperationException 错误 谁帮我看看怎么解决.
- 关于输出的简单问题
- 求教DataGrid的源码
- 聘一程序员修改一商业网业(语言包括asp,php)
- 各位老大,一个网站,我写了一个namespace GoodShop,手动写并编译了一个GoodShop的类....?????
- 請問各位高手,急啊,有關全文檢索問題?思歸啊!!!!!!!
- 网站在本地测试没问题,发布到服务器上出问题……
- 如何将DataTable中的数据插入到GridView中?
window.top.document.getElementById("tdbudgetExecStatusReportDetails")
当你点击 iframe1 的 某控件,可 传值过去,并刷新 iframe2,然后根据值,做你需要的操作!
<input id="aaa"/>
<iframe id="frameAuditMain" src="bbbb.aspx"></iframe>
</form>在 bbbb.aspx 页面
JS :function fun()
{
if(window.top != undefined)
{
var a = window.top.document.getElementById("aaa")
}
}
可以取得到帮 LZ测试!呵呵
window.parent.document.getElementById("tdbudgetExecStatusReportDetails")