<scritp language= "javascript">
function Change(targetID)
{
if (document.getElementById){
target = document.getElementById(targetID);
if (target.style.display == "none") {
target.style.display = "";
} else {
target.style.display = "none";
}
}
</script>
<a onclick="Change('MyDiv');return false;" href="./#">View/Hide</a>
<div id="MyDiv">
...(some controls)
</div>
本程序段从.Text中提炼而来,
return false屏蔽掉了PostBack提交,
而href="./#"将链接链回至当前页的锚
function Change(targetID)
{
if (document.getElementById){
target = document.getElementById(targetID);
if (target.style.display == "none") {
target.style.display = "";
} else {
target.style.display = "none";
}
}
</script>
<a onclick="Change('MyDiv');return false;" href="./#">View/Hide</a>
<div id="MyDiv">
...(some controls)
</div>
本程序段从.Text中提炼而来,
return false屏蔽掉了PostBack提交,
而href="./#"将链接链回至当前页的锚