要让弹出的模式对话框获得最新的记录,就需要清空模式对话框所在网页的缓存,以便能得到最新记录,这就需要在网页的<head></head>中间添加如下代码:
<
meta
http-equiv
="PRAGMA"
content
="NO-CACHE"
>
为了能够正常使用模式对话框中的服务器端控件,避免弹出网页的烦恼,在网页的标头中加如下代码:
<
base
target
="_self"
/>
完整代码如下:
<
head
runat
="server"
>
<
title
>
无标题页
</
title
>
<
meta
http-equiv
="PRAGMA"
content
="NO-CACHE"
>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
<
script
type
="text/javascript"
language
="javaScript"
src
="/_layouts/images/include/timein.js"
></
script
>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
<
link
href
="../CSS/style.css"
rel
="Stylesheet"
type
="text/css"
/>
<
base
target
="_self"
/>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
</
head
>
这样就解决了弹出对话框的问题了.还有在标签选项卡中使用服务器端控件防止选项卡重置的问题,代码如下:
<%
...
@ Page Language="C#" AutoEventWireup="true" CodeFile="CarAllInfo.aspx.cs" Inherits="web_CarsManage_CarAllInfo"
%>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<%
...
@ Register Src="Controls/CarAllInfoControls/CarYearCheckInfo.ascx" TagName="CarYearCheckInfo"
TagPrefix="uc3"
%>
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<%
...
@ Register Src="Controls/CarAllInfoControls/CarMaintainInfo.ascx" TagName="CarMaintainInfo"
TagPrefix="uc4"
%>
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<%
...
@ Register Src="Controls/CarAllInfoControls/CarOilInfo.ascx" TagName="CarOilInfo"
TagPrefix="uc5"
%>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<%
...
@ Register Src="../CarAttemper/Controls/CarInfo.ascx" TagName="CarInfo" TagPrefix="uc1"
%>
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<%
...
@ Register Src="Controls/CarAllInfoControls/CarInfo.ascx" TagName="CarInfo" TagPrefix="uc2"
%>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<
script
language
="JavaScript"
>
...
//Switch Tab Effect
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
function switchTab(tabpage,tabid)...{
var oItem = document.getElementById(tabpage);
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
for(var i=0;i<oItem.children.length;i++)...{
var x = oItem.children(i);
x.className = "";
var y = x.getElementsByTagName('a');
y[0].style.color="#333333";
}
document.getElementById(tabid).className = "Selected";
var dvs=document.getElementById("cnt").getElementsByTagName("div");
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
for (var i=0;i<dvs.length;i++)...{
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
if (dvs[i].id==('d'+tabid) && dvs[i].controlFlag == "yes")...{
dvs[i].style.display='block';
document.getElementById("ChosedIndexId").value = dvs[i].choseIndex;
}
else if(dvs[i].controlFlag == "yes")
dvs[i].style.display='none';
}
}
![](https://i-blog.csdnimg.cn/blog_migrate/6a9c071a08f1dae2d3e1c512000eef41.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
function doInitTab()...{
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
try...{
var index = document.getElementById("ChosedIndexId").value;
var showDivName = "Tab" + index;
switchTab('TabPage1',showDivName);
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
}catch(ex)...{}
}
</
script
>
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<
style
type
="text/css"
>
...
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
body {...}{font-size:12px;font-family:宋体}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1{...}{
list-style:none;
margin:0;
padding:0;
height:29px;
background-image:url(Images/q20066292643.gif);
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li{...}{
float:left;
padding:0;
height:29px;
margin-right:1px;
background:url(Images/320066292748.gif) left top no-repeat;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li a{...}{
display:block;
line-height:29px;
padding:0 20px;
color:#333;
background:url(Images/w20066292815.gif) right top no-repeat;
white-space: nowrap;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li.Selected{...}{
background:url(Images/220066292838.gif) left top no-repeat;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li.Selected a{...}{
background:url(Images/42006629294.gif) right top no-repeat;
}
![](https://i-blog.csdnimg.cn/blog_migrate/6a9c071a08f1dae2d3e1c512000eef41.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li a:link,ul.TabBarLevel1 li a:visited{...}{
color:#333;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li a:hover,ul.TabBarLevel1 li a:active{...}{
color:#F30;
text-decoration:none;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li.Selected a:link,ul.TabBarLevel1 li.Selected a:visited{...}{
color:#000;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
ul.TabBarLevel1 li.Selected a:hover,ul.TabBarLevel1 li.Selected a:active{...}{
color:#F30;
text-decoration:none;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
div.HackBox {...}{
padding : 2px 2px ;
border-left: 2px solid #6697CD;
border-right: 2px solid #6697CD;
border-bottom: 2px solid #6697CD;
display:none;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.table{...}{
text-align:left;
width:100%;
border:2px solid #ABCFFF;
}
![](https://i-blog.csdnimg.cn/blog_migrate/6a9c071a08f1dae2d3e1c512000eef41.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.table td{...}{
height:22px;
line-height:22px;
text-indent:12px;
border:1px solid #ABCFFF;
text-decoration:none;
overflow:hidden;
padding-top:0px;
overflow:hidden;
}
.table td a
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
{...}{
white-space:normal;
overflow:auto;
text-decoration: none;
color:#264F7B;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.table td a:hover{...}{
color:#FF0000;
text-decoration:none;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.table th{...}{
height:23px;
line-height:23px;
background-color:#CDE7FE;
border:0px solid #ABCFFF;
background-image:url(/_layouts/images/images/di_03.gif);
background-repeat:repeat-x;
font-weight:normal;
text-indent:12px;
color:#000000;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.table th a{...}{
border-bottom:none;
height:23px;
line-height:23px;
text-align:center;
text-decoration:none;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.table th a:hover{...}{
height:23px;
line-height:23px;
background:#efefef;
}
![](https://i-blog.csdnimg.cn/blog_migrate/37c8bf68cdc3cc81759c34160776bc53.gif)
.tr2{...}{
background:#DDEEFE;
}
![](https://i-blog.csdnimg.cn/blog_migrate/0196c3df5ea9e936f21e9932cca91014.gif)
</
style
>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
<
link
href
="../CSS/style.css"
type
="text/css"
/>
<
body
style
="text-align: center"
>
<
form
id
="form1"
runat
="server"
>
<
div
id
="Whatever"
>
<
ul
class
="TabBarLevel1"
id
="TabPage1"
>
<
li
id
="Tab1"
><
a
href
="#"
onclick
="javascript:switchTab('TabPage1','Tab1');"
>
车辆基本信息
</
a
></
li
>
<
li
id
="Tab2"
><
a
href
="#"
onclick
="javascript:switchTab('TabPage1','Tab2');"
>
车辆年检信息
</
a
></
li
>
<
li
id
="Tab3"
><
a
href
="#"
onclick
="javascript:switchTab('TabPage1','Tab3');"
>
车辆维修信息
</
a
></
li
>
<
li
id
="Tab4"
><
a
href
="#"
onclick
="javascript:switchTab('TabPage1','Tab4');"
>
车辆油耗信息
</
a
></
li
>
</
ul
>
<
div
id
="cnt"
>
<
div
id
="dTab1"
choseIndex
="1"
class
="HackBox"
controlFlag
="yes"
>
<
uc2:CarInfo
ID
="CarInfo1"
runat
="server"
/>
</
div
>
<
div
id
="dTab2"
choseIndex
="2"
controlFlag
="yes"
class
="HackBox"
>
<
uc3:CarYearCheckInfo
ID
="CarYearCheckInfo1"
runat
="server"
/>
</
div
>
<
div
id
="dTab3"
choseIndex
="3"
controlFlag
="yes"
class
="HackBox"
>
<
uc4:CarMaintainInfo
ID
="CarMaintainInfo1"
runat
="server"
/>
</
div
>
<
div
id
="dTab4"
choseIndex
="4"
controlFlag
="yes"
class
="HackBox"
>
<
uc5:CarOilInfo
id
="CarOilInfo1"
runat
="server"
>
</
uc5:CarOilInfo
>
</
div
>
</
div
>
<
input
id
="ChosedIndexId"
type
="hidden"
value
="1"
runat
="server"
/>
</
div
>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
</
form
>
![](https://i-blog.csdnimg.cn/blog_migrate/a41954a27d6ad96fa2c2cf816e677448.gif)
<
script
language
="javascript"
>
...
window.onload = doInitTab;
</
script
>
</
body
>