Last post Sep 30, 2016 04:49 AM by email@example.com
Sep 29, 2016 09:57 AMfirstname.lastname@example.org|LINK
Can you please help in Removing Master Page and Side User Controls in my
aspx page as I am trying to open multiple pages in a Iframe and we don't need master page and User Control. The page looks Typically as shown below :
Below is the code for Including Master Page and PurchaseVerticalMenu.ascx .
Could you please help me in removing the master page through C# code [Programmatically] ?
<%@ Page Language="C#" MasterPageFile="~/Essel.master" AutoEventWireup="true" CodeFile="BasicPriceUpdation.aspx.cs"
Inherits="BasicPriceUpdation" Title="Basic Price Updation" EnableEventValidation="false" %>
<%@ Register Src="~/PurchaseVerticalMenu.ascx" TagName="Menu" TagPrefix="PurchaseMenu" %>
Sep 29, 2016 10:29 AM|Siva Krishna Macha|LINK
Instead of Remove reference, how about setting a master page with blank content - in that scenario? That should work for you.
See this discussion: http://forums.asp.net/t/1170081.aspx?Removing+master+page+at+runtime
Sep 30, 2016 03:29 AM|Cathy Zou|LINK
From your description, you want to remove the master page when open a content page in a frame. if that the case, you could refer to the two solution in the following.
You could probably pass a parameter into the page (through the querystring for example), which, when set, switches the masterpage to one that is effectively blank (since your page wont work without a masterpage).
So something like this in the Page_PreInit method:
if (Request.QueryString["iframe"] == "true")
MasterPageFile = blankMasterPageFile;
1.Create a new blank Master Page MasterPage.master
2.Open Default.aspx file change MasterPageFile property
<%@ Page MasterPageFile="~/Site.master"%>
<%@ Page MasterPageFile="~/MasterPage.master" %>
3.Update ContentPlaceHolderID with the ID which is provided in MasterPage.master file
Hope this can help you. If you have any question and confusion about the problem. Please don't hesitate to let me know.
Sep 30, 2016 04:49 AMemail@example.com|LINK
Thank you Very Much.. It helped in resolving the Issue.