<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<link href="Commonality.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Contract.js"></script>
</head>
<body onload="init();">
<form id="form1" runat="server">
<div id="divcenter800">
<div id="TabOnLineDeal" class="TabNotHit">交易 </div>
<div id="TabTransfer" class="TabNotHit">转帐 </div>
<div id="TabModify" class="TabNotHit">变更 </div>
</div>
<div id="OnLineDeal" class="SelectNoteTr">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
</div>
<div id="Transfer" style="display:none;" class="SelectNoteTr">
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True">
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
</asp:DropDownList>
</div>
<div id="Modify" style="display:none;" class="SelectNoteTr">
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True">
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
</asp:DropDownList>
</div>
</form>
</body>
</html>
css------------
#divcenter800
{
margin-left: auto;
margin-right: auto;
width: 780px;
}
.TabHit
{
float: left;
background-image: url(cordhit.gif);
padding-top: 3px;
text-align: center;
height: 19px;
width: 63px;
}
.TabNotHit
{
text-align: center;
padding-top: 3px;
float: left;
cursor: hand;
height: 19px;
width: 63px;
}
.SelectNoteTr
{
margin-left: auto;
margin-right: auto;
margin-top: 2px;
width: 780px;
padding-top: 0px;
font-family: 宋体;
font-size: 12px;
height: 20px;
}javascript---------------
function SelectTabNode()
{
var TabOnLineDeal=document.getElementById("TabOnLineDeal");
TabOnLineDeal.className="TabNotHit" ;
var TabTransfer=document.getElementById("TabTransfer");
TabTransfer.className="TabNotHit" ;
var TabModify=document.getElementById("TabModify");
TabModify.className="TabNotHit" ;
this.className="TabHit";
var OnLineDeal=document.getElementById("OnLineDeal");
OnLineDeal.style.display="none";
var Transfer=document.getElementById("Transfer");
Transfer.style.display="none";
var Modify=document.getElementById("Modify");
Modify.style.display="none";
document.getElementById(this.id.replace('Tab','')).style.display="";
}
function init()
{
var TabOnLineDeal=document.getElementById("TabOnLineDeal");
TabOnLineDeal.onclick=SelectTabNode; var TabTransfer=document.getElementById("TabTransfer");
TabTransfer.onclick=SelectTabNode;
var TabModify=document.getElementById("TabModify");
TabModify.onclick=SelectTabNode;
}这个层显示的已经ok了!现在最大的问题就是当我选择一个层下面的一个下拉列表里面的值(我设置了AutoPostBack="True" 这个一定要)
这个页面就老刷回去: 比如选择(转帐)下面的 DropDownList2 的值 页面就又回到(交易)这层了
我现在就是想要我选择任何一层下的DropDownList 的值 页面都不动 谢谢高手提点!!!!
<head runat="server">
<title>无标题页</title>
<link href="Commonality.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Contract.js"></script>
</head>
<body onload="init();">
<form id="form1" runat="server">
<div id="divcenter800">
<div id="TabOnLineDeal" class="TabNotHit">交易 </div>
<div id="TabTransfer" class="TabNotHit">转帐 </div>
<div id="TabModify" class="TabNotHit">变更 </div>
</div>
<div id="OnLineDeal" class="SelectNoteTr">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
</div>
<div id="Transfer" style="display:none;" class="SelectNoteTr">
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True">
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
</asp:DropDownList>
</div>
<div id="Modify" style="display:none;" class="SelectNoteTr">
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True">
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
</asp:DropDownList>
</div>
</form>
</body>
</html>
css------------
#divcenter800
{
margin-left: auto;
margin-right: auto;
width: 780px;
}
.TabHit
{
float: left;
background-image: url(cordhit.gif);
padding-top: 3px;
text-align: center;
height: 19px;
width: 63px;
}
.TabNotHit
{
text-align: center;
padding-top: 3px;
float: left;
cursor: hand;
height: 19px;
width: 63px;
}
.SelectNoteTr
{
margin-left: auto;
margin-right: auto;
margin-top: 2px;
width: 780px;
padding-top: 0px;
font-family: 宋体;
font-size: 12px;
height: 20px;
}javascript---------------
function SelectTabNode()
{
var TabOnLineDeal=document.getElementById("TabOnLineDeal");
TabOnLineDeal.className="TabNotHit" ;
var TabTransfer=document.getElementById("TabTransfer");
TabTransfer.className="TabNotHit" ;
var TabModify=document.getElementById("TabModify");
TabModify.className="TabNotHit" ;
this.className="TabHit";
var OnLineDeal=document.getElementById("OnLineDeal");
OnLineDeal.style.display="none";
var Transfer=document.getElementById("Transfer");
Transfer.style.display="none";
var Modify=document.getElementById("Modify");
Modify.style.display="none";
document.getElementById(this.id.replace('Tab','')).style.display="";
}
function init()
{
var TabOnLineDeal=document.getElementById("TabOnLineDeal");
TabOnLineDeal.onclick=SelectTabNode; var TabTransfer=document.getElementById("TabTransfer");
TabTransfer.onclick=SelectTabNode;
var TabModify=document.getElementById("TabModify");
TabModify.onclick=SelectTabNode;
}这个层显示的已经ok了!现在最大的问题就是当我选择一个层下面的一个下拉列表里面的值(我设置了AutoPostBack="True" 这个一定要)
这个页面就老刷回去: 比如选择(转帐)下面的 DropDownList2 的值 页面就又回到(交易)这层了
我现在就是想要我选择任何一层下的DropDownList 的值 页面都不动 谢谢高手提点!!!!
解决方案 »
- 请问如何在asp.net上实现wml/wap的预览页面
- 一个小问题都搞不好,罚自己不能喝牛奶了今天。
- TextBox MultiLine Maxlength
- vs2005 请问如何将GRIDVIEW选定行的内容显示在textbox上? 代码如下点击没发应
- 求教:如何在DropDownList中使用CheckBoxList或者令到DropDownList中的项能够多选?
- 用ajax.net在前台运行后台函数没有反应?
- 如何实现GridView合并行列
- 怎么在C#中定义一个httpResponse实例?
- 不同地方人怎么访问同一个地方的系统
- 自定义控件绑定数据
- 高分求一正则表达式(在线等)
- 求一段判断改字符串是否包含HTML代码的代码
那只好这样了
protected void Page_Load(object sender, EventArgs e)
{
this.DropDownList1.Attributes.Add("onchange", "return false;");
this.DropDownList2.Attributes.Add("onchange", "return false;");
this.DropDownList3.Attributes.Add("onchange", "return false;");
}
页面重新load过了 根据你的代码,你现在显示的是 转帐 这个层,页面重新load时,这个层的display又变成none了你可以这样做放一个hidden,用来存你页面load后要显示的层的id
function SelectTabNode()里面根据这个hidden的值来确定哪个层是显示的