我有一个带有 webpart 的 aspx 共享点页面。如何将 display=none 设置为 webpart 代码隐藏(ascx.cs)内的页面(aspx)中的 div。
代码:
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script type="text/javascript">
function ShowGearPage() {
var gearPage = document.getElementById("GearPage");
gearPage .style.display = "block";
var loginPage = document.getElementById("MasterTable");
loginPage.style.display = "none";
return true;
}
</script>
<div align="center" id="GearPage" style="display:none;">
<div id="s4-simple-card" class="s4-simple-gearpage">
<div id="s4-simple-card-content">
<h1>
<img id="gearsImage" alt="This animation indicates the operation is in progress."
src="gears_anv4.gif" style="width: 24px; height: 24px; font-size: 0px;"
align="middle" />
Processing...
</h1>
<div>
</div>
</div>
</div>
ShowGearPage();
我想隐藏 GearPage div 并在 DisplayReportWebPart webpart 代码隐藏中显示主 div。