locked
Hiding menu from Iframe RRS feed

  • Question

  • User355715116 posted

    I am displaying one of mypages in an iframe and this page uses the same master page as others and this master page has a menu and I want to hide this menu if the page is displayed inside an iframe?

    How can i do this?

    Regards, 

    Mazharul007

    Tuesday, May 5, 2020 1:11 PM

All replies

  • User475983607 posted

    Add a querystring to the iframe src. 

    src="/default.aspx?nav=off"

    Check for the querystring in the Master Page's Page_Load event to toggle the navigation bar visibility.

    Tuesday, May 5, 2020 1:56 PM
  • User355715116 posted

    Can you please explain a little bit more. As i am new to asp.net so couldn't understand. If you explain it a bit more than it will be easier for me to understand. 


    protected void Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
    {
    LoadMenu();
    DataTable dt = FollowUpManager.GetWeeklyFollowUpByUserID(UserId, true);
    if (dt.Rows.Count > 0)
    {
    btnFollowUp.Text = dt.Rows.Count.ToString();
    }
    else
    {
    btnFollowUp.Text = "0";
    }
    GetApplicantCount();
    GetLastAddEditApplicantId();
    }
    if (!Request.Url.AbsoluteUri.Contains(FormsAuthentication.DefaultUrl))
    {
    CheckAuthority();
    }
    }



    This is my page_load() from master page. 

    Thanks 

    Tuesday, May 5, 2020 3:22 PM
  • User283571144 posted

    Hi mazharul007,

    I found you have a same issue which I have already replied in another thread. 

    I suggest you could refer to that thread to solve your issue.

    Link:https://forums.asp.net/t/2166620.aspx?Menu+visible+false+from+Iframe 

    Best Regards,

    Brando

    Saturday, May 9, 2020 2:21 AM