Hide button in MasterPage

Posted on 2007-10-02
Last Modified: 2008-01-09
I am using a MasterPage with a button, and I want to hide this button for a particular page.  To be more specific, I have a Signup.aspx page that uses a MasterPage, where the MasterPage have a button called btn_paybutton.  But I want to hide the button for the Signup.aspx page.  Is it possible to do that?  How?
Question by:cmleung2
    LVL 4

    Accepted Solution

    In the page using the Master, cast the button locally and then make it not visible.

    So in the page class
    dim myButton as Button

    Then in page_load
    myButton = CType(Master.FindControl("Button1"), Button)   'where Button1 is the Master page button name
    myButton.Visible = false

    LVL 1

    Author Comment

    works perfectly. thanks.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    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…
    Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video teaches users how to migrate an existing Wordpress website to a new domain.

    754 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

    19 Experts available now in Live!

    Get 1:1 Help Now