Hide DIV on Master Page?

Posted on 2009-04-17
Last Modified: 2012-06-22
I have a content page with an Accordian control that's doing strange thins to my DIV footer. All the other content pages work perfectly except the page with the Accordian. The DIV footer is always on top of the DIV content, only with the Accordian page. I think hiding the DIV footer when the certain page is the only answer.

Q. How do I hide a DIV on a master page from a content page?

Question by:pointeman
    LVL 39

    Accepted Solution

    If I assume for a moment the CSS is not in order here and assume that with "hide" you mean Visible = False, you can do this:

    in the Master page create a public method:
    Public Sub SetDivVisible(visible As Boolean)    myDivId.Visible = visibleEnd Sub
    in the page where you need to access this, you set the MasterType property to your master page:

    <%@ MasterType VirtualPath="yourMaster.master"  %>
    and call the method like this:

    LVL 6

    Assisted Solution

    It could be because of float issues. Did you try adding a <br style="clear:both" /> underneath the accordion.

    If you want to hide a div on a specific page, add a body id to the page and then target the div you want to hide in the CSS with "display: none;" so it would look like this if your body ID is home and DIV is called accordion.

    #home #accordion {
    display: none;

    Author Comment

    Ok, found the problem. I had a missing table closing tag </table>. So everytime the Accordian expanded, it slid under the DIV footer.
    However, that's a cool way to reference the Master page htm tags.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now