Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Logout control hide in login page using master page

Logout control hide in login page using master page

Scheduled Pinned Locked Moved ASP.NET
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rakeshs312
    wrote on last edited by
    #1

    Hi all, I have a control in my master page like this
    Logout How i can hide this in my login page using this master page

    B J N V 4 Replies Last reply
    0
    • R rakeshs312

      Hi all, I have a control in my master page like this
      Logout How i can hide this in my login page using this master page

      B Offline
      B Offline
      Bilal Ahmed Lilla
      wrote on last edited by
      #2

      You can define the property on the master page and set its value visibility to true of false on content page by using their property.

      R 1 Reply Last reply
      0
      • B Bilal Ahmed Lilla

        You can define the property on the master page and set its value visibility to true of false on content page by using their property.

        R Offline
        R Offline
        rakeshs312
        wrote on last edited by
        #3

        Menu MyMasterMenu = (Menu)Master.FindControl("logoutLink"); MyMasterMenu.Visible = false; I done like this in my login page but not working

        P 1 Reply Last reply
        0
        • R rakeshs312

          Menu MyMasterMenu = (Menu)Master.FindControl("logoutLink"); MyMasterMenu.Visible = false; I done like this in my login page but not working

          P Offline
          P Offline
          prateeksinghgangwar
          wrote on last edited by
          #4

          In the Page_Load() of the Masterpage.cs try out the following if(Session["login"]!="") //make visible the "logout" link else //make visible the "login" link

          1 Reply Last reply
          0
          • R rakeshs312

            Hi all, I have a control in my master page like this
            Logout How i can hide this in my login page using this master page

            J Offline
            J Offline
            jkirkerx
            wrote on last edited by
            #5

            <a id="logoutLink" runat="server" href="" style="display: none;" class="logout">Logout

            J 1 Reply Last reply
            0
            • R rakeshs312

              Hi all, I have a control in my master page like this
              Logout How i can hide this in my login page using this master page

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              If it were my project I would create this as a server control and have it set its own visibility. That way it could be used anywhere and not so tightly coupled to your masterpage.


              Failure is not an option; it's the default selection.

              1 Reply Last reply
              0
              • J jkirkerx

                <a id="logoutLink" runat="server" href="" style="display: none;" class="logout">Logout

                J Offline
                J Offline
                jkirkerx
                wrote on last edited by
                #7

                I guess it would be, this is hand type off the top of my head

                Logout

                Then in your code behind page on the Page.Load hl_Logout.visible = False;

                1 Reply Last reply
                0
                • R rakeshs312

                  Hi all, I have a control in my master page like this
                  Logout How i can hide this in my login page using this master page

                  V Offline
                  V Offline
                  vvashishta
                  wrote on last edited by
                  #8

                  Create two different masterpages one for specifically LoginPage without any Menu or Logout Ribbon and other for after Login with all functionality.

                  - Happy Coding - Vishal Vashishta

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups