我想只有當這一條件得到滿足,以顯示這部分嘗試使用「style.visibility」
<tr>
<div id="contact" class="uniForm" style="visibility: hidden; display: none;">
<fieldset class="blockLabels">
<legend style="font-size: 10pt;">Contacts</legend>
<div class="ctrlHolder">
<%= this.strContactInfo%>
</div>
</fieldset>
</div>
</tr>
設置一個div在代碼中可見:
if (iStatus == 2)
{
lblAccessError2.Text = "Failure. ";
Page.ClientScript.RegisterStartupScript(this.GetType(), "clientscript1", "document.getElementById('contact').style.visibility = 'visible';", true);
ModalPopupExtender1.Show();
}
而問題是? – Alexander
它保持隱藏狀態,即使符合條件也不會顯示... – Aravindh
並且您忘記了'display:block' – Aristos