[英]How to access div in sharepoint aspx in its webpart codebehind
我有一个带webpart的aspx共享点页面。 如何在webpart代码背后(ascx.cs)内的页面(aspx)中将display = none设置为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代码中显示Master div。
将runat="server"
添加到div并使用divId.Attributes("Style","display:none");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.