locked
Menu visible false from Iframe RRS feed

  • Question

  • User355715116 posted

    How to make visible false of menus that inherited from Master page  from an Iframe?

    Note : I am using Telerik Web UI and Radmenu

    Regards,

    Tuesday, May 5, 2020 9:21 AM

Answers

  • User283571144 posted

    Hi mazharul007,

    According to your description, I suggest you could use jquery to achieve your requirement.

    You could use window.parent.location to check the page is inside the iframe. If inside the iframe, you could set the master page's menu visible attribute by using jquery selector.

    More details, you could refer to below codes:

    $(document).ready(function () {
              if (window.location !== window.parent.location) {
                    // The page is in an iframe , set menu invisible
                  $("#mainMenu").css('visibility', 'hidden');
    // do the same thing
                    //$("#mainMenu").css('display', 'none');
              } else {
                    // The page is not in an iframe, it will show the menu
              }
          });
    

    Note: “mainMenu” is your menu ID in master page.

    Result:

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 6, 2020 9:17 AM

All replies

  • User283571144 posted

    Hi mazharul007,

    According to your description, I suggest you could use jquery to achieve your requirement.

    You could use window.parent.location to check the page is inside the iframe. If inside the iframe, you could set the master page's menu visible attribute by using jquery selector.

    More details, you could refer to below codes:

    $(document).ready(function () {
              if (window.location !== window.parent.location) {
                    // The page is in an iframe , set menu invisible
                  $("#mainMenu").css('visibility', 'hidden');
    // do the same thing
                    //$("#mainMenu").css('display', 'none');
              } else {
                    // The page is not in an iframe, it will show the menu
              }
          });
    

    Note: “mainMenu” is your menu ID in master page.

    Result:

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 6, 2020 9:17 AM
  • User355715116 posted

    Dear Brando, It worked. Thanks a lot. 

    Wednesday, May 6, 2020 9:23 AM