简体   繁体   English

如何在其WebPart代码中的sharepoint aspx中访问div

[英]How to access div in sharepoint aspx in its webpart codebehind

i have an aspx sharepoint page with webpart. 我有一个带webpart的aspx共享点页面。 how to set display=none to a div in the page(aspx) inside the webpart codebehind(ascx.cs). 如何在webpart代码背后(ascx.cs)内的页面(aspx)中将display = none设置为div。

code: 码:

<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(); ShowGearPage();

I want to hide the GearPage div and show the Master div in the DisplayReportWebPart webpart codebehind. 我想隐藏GearPage div并在后面的DisplayReportWebPart Webpart代码中显示Master div。

runat="server"添加到div并使用divId.Attributes("Style","display:none");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM