Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 277165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:02:02+00:00 2026-05-12T01:02:02+00:00

Just wondering if you know how to accessing controls on a sharepoint master page

  • 0

Just wondering if you know how to accessing controls on a sharepoint master page in code at runtime, I using

System.Web.UI.HtmlControls.HtmlGenericControl logout = (System.Web.UI.HtmlControls.HtmlGenericControl)this.Master.FindControl(“logout_switch”);

logout.Style[“display”] = “block;”;

Which seems to find the control but the changes made to that control aren’t reflected on postback eg. the div logout control isn’t visible.

Is this possible in sharepoint master pages ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:02:02+00:00Added an answer on May 12, 2026 at 1:02 am

    Very well you can access the Controls in the Master Page, accessing the SharePoint Master page is no different from the ASP.NET master page and the code you have written for is right.
    From your question its clear that logout is not null. which means that it is there and the div has runat=”server”. If any of these is false then you need to adjust the code accordingly.

    Also check where you call the code

    logout.Style["display"] = "block";
    

    Another alternate I would suggest is to do this stuff in the Client side if you are
    able to do. Small java script code to show or hide the control,

    function setControl(show){ if (show) login.style.display='block'; else login.style.display='none';}
    

    And call the above code from server side RegersterStartupScript

    Else you can try using the LoginStatus Control

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering if any of you guys know of any web-based/browser-based employee scheduling software/tools?
I am just wondering if anyone know of some good tutorials on the Internet
Just wondering if a .NET app can be compiled down to native machine code
just wondering if anyone know the correct intent to launch Firefox's Mobile Browser. I
Just wondering if anyone know a good flex tutorial website besides Adobe. Appreciate the
So I know that C++ is strongly typed and was just wondering if there
was just wondering what formats of databases can SQLite support. i only know of
Just wondering if anyone know if in general you can use the MVC UI
I know PHP has call_user_func , I was just wondering if JavaScript had something
I am just wondering if anyone know of a good resource/tutorial/video for explaining the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.