急求ASP.NET中tab页面切换问题

tourstar 2010-04-25 08:52:46
为什么tab页面中的内容,里面如果有ASP.NET控件的话,我点击ASP.NET控件,这个页面就不显示了?
tab按钮和内容都是用div布局

aspx代码:
<%-- 已发 --%>
<div id="tab_button_1" class="tab_button_active_1" onmouseover="activeButtonPage(this,tab_button_1);" onmouseout="deactiveButtonPage(this,tab_button_1);"
onmousedown="activeTabPage(this,document.all.tab_page_1,tab_button_1);" style="left: 53px; top: 8px; width:37px;" ></div>

<%-- 已收 --%>
<div id="tab_button_2" class="tab_button_deactive_2" onmouseover="activeButtonPage(this,tab_button_2);" onmouseout="deactiveButtonPage(this,tab_button_2);"
onmousedown="activeTabPage(this,document.all.tab_page_2,tab_button_2);" style="left: 12px; top: 8px; width:37px;" ></div>

<%-- 已发 --%>
<div id="tab_page_1" class="tab_page_active" style="left: 0px; top: 42px">
<p><iframe src="note/note_leftFrom.aspx" width="100%" height="100%" scrolling="auto" frameborder="0" marginheight="0" marginwidth="0" name="main1" id="Iframe1"></iframe></p>
</div>

<%-- 已收 --%>
<div id="tab_page_2" class="tab_page_deactive">
<p><iframe src="note/note_leftTo.aspx" width="100%" height="100%" scrolling="auto" frameborder="0" marginheight="0" marginwidth="0" name="main1" id="Iframe2"></iframe></p>

css代码:

这是显示内容的
/*激活状态的Tab页内容*/
.tab_page_active
{
position:absolute;
left:0px;
top:42px;
width:100%;
height:100%;
color:#CE0000;
border-top-color:#CE0000;
border-top-width:0px;
border-top-style:solid;
border-left-color:#CE0000;
border-left-width:0px;
border-left-style:solid;
border-bottom-color:#CE0000;
border-bottom-width:0px;
border-bottom-style:solid;
border-right-color:#CE0000;
border-right-width:0px;
border-right-style:solid;
padding-top:0px;
display:block;
font-size:14px;

}

/*非激活状态的Tab页内容*/
.tab_page_deactive
{
display:none;
}


我想问一下,为什么重新加载页面之后,tab按钮所指向的页面内容就不显示了呢?应该如何解决呢?
...全文
663 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhoulingsmile 2010-04-25
  • 打赏
  • 举报
回复
up up up !!!
haitun0921 2010-04-25
  • 打赏
  • 举报
回复
javascrip 交流群:97470659
asp.net 交流群:106041515
java 交流群: 106041212
sql server 交流群:33968565

欢迎大家加入讨论
wuyq11 2010-04-25
  • 打赏
  • 举报
回复
检查DIV设置
还有multiview,ajax,jquery中tab控件
http://www.scriptlover.com/controls/main.html
tourstar 2010-04-25
  • 打赏
  • 举报
回复
我用js了,下面就是我js代码:
var actTabButton = null;
var actTabPage = null;
var ViewState = null;

function activeTabPage(tabButton,tabPage,actButton)
{
//刚进入页面时,激活的页面导航页面和菜单
if(actTabButton == null)
{
actTabButton = document.all.tab_button_1;
actTabButton.oldZIndex = actTabButton.style.zIndex;
actButton = document.all.tab_button_1;
}

if(actTabPage == null)
{
actTabPage = document.all.tab_page_1;
}

if(actButton == document.all.tab_button_1)
{
ViewState = document.all.tab_button_1;

actTabButton = document.all.tab_button_2;
//把当前已经激活的页面隐藏
actTabButton.setAttribute("class","tab_button_deactive_2");
actTabButton.setAttribute("className","tab_button_deactive_2");
actTabButton.style.zIndex = actTabButton.oldZIndex;

actTabPage.setAttribute("class","tab_page_deactive");
actTabPage.setAttribute("className","tab_page_deactive");

//将当前激活页面设置为传入的tabButton和tabPage
actTabButton = tabButton;
actTabPage = tabPage;

actTabButton.setAttribute("class","tab_button_active_1");
actTabButton.setAttribute("className","tab_button_active_1");
actTabButton.oldZIndex = actTabButton.style.zIndex;
actTabButton.style.zIndex = 5000;

actTabPage.setAttribute("class","tab_page_active");
actTabPage.setAttribute("className","tab_page_active");
document.frames('Iframe1').location.reload();
}
else if(actButton == document.all.tab_button_2)
{
ViewState = document.all.tab_button_2;

//把当前已经激活的页面隐藏
actTabButton = document.all.tab_button_1;
actTabButton.setAttribute("class","tab_button_deactive_1");
actTabButton.setAttribute("className","tab_button_deactive_1");
actTabButton.style.zIndex = actTabButton.oldZIndex;


actTabPage.setAttribute("class","tab_page_deactive");
actTabPage.setAttribute("className","tab_page_deactive");


//将当前激活页面设置为传入的tabButton和tabPage
actTabButton = tabButton;
actTabPage = tabPage;

actTabButton.setAttribute("class","tab_button_active_2");
actTabButton.setAttribute("className","tab_button_active_2");
actTabButton.oldZIndex = actTabButton.style.zIndex;
actTabButton.style.zIndex = 5000;

actTabPage.setAttribute("class","tab_page_active");
actTabPage.setAttribute("className","tab_page_active");
document.frames('Iframe2').location.reload();
}

}



function activeButtonPage(tabButton,actButton)
{
if(ViewState == null)
{
ViewState = document.all.tab_Button_1;
}

//将当前激活页面设置为传入的tabButton和tabPage
if(actButton == document.all.tab_button_1)
{
if(ViewState != document.all.tab_button_1)
{
actTabButton = tabButton;

actTabButton.setAttribute("class","tab_button_active_1");
actTabButton.setAttribute("className","tab_button_active_1");
actTabButton.oldZIndex = actTabButton.style.zIndex;
actTabButton.style.zIndex = 5000;
}
}
else if(actButton == document.all.tab_button_2)
{
if(ViewState != document.all.tab_button_2)
{
actTabButton = tabButton;

actTabButton.setAttribute("class","tab_button_active_2");
actTabButton.setAttribute("className","tab_button_active_2");
actTabButton.oldZIndex = actTabButton.style.zIndex;
actTabButton.style.zIndex = 5000;
}
}
}


function deactiveButtonPage(tabButton,actButton)
{
if(ViewState == null)
{
ViewState = document.all.tab_button_1;
}

//将当前激活页面设置为传入的tabButton和tabPage
if(actButton == document.all.tab_button_1)
{
if(ViewState != document.all.tab_button_1)
{
actTabButton = tabButton;

actTabButton.setAttribute("class","tab_button_deactive_1");
actTabButton.setAttribute("className","tab_button_deactive_1");
actTabButton.oldZIndex = actTabButton.style.zIndex;
actTabButton.style.zIndex = 5000;
}
}
else if(actButton == document.all.tab_button_2)
{
if(ViewState != document.all.tab_button_2)
{
actTabButton = tabButton;

actTabButton.setAttribute("class","tab_button_deactive_2");
actTabButton.setAttribute("className","tab_button_deactive_2");
actTabButton.oldZIndex = actTabButton.style.zIndex;
actTabButton.style.zIndex = 5000;
}
}
}
xray2005 2010-04-25
  • 打赏
  • 举报
回复
你可以使用JS显示实现。

页面回发后,重新加载页面,之前的客户端操作当然没有了

62,050

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧