Hi,
What I do is pass a querystring value to indicate that the user has clicked
the print-friendly link. I detect that in the pre_init event and change the
master there. Here's some VB code:
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As
System.EventArgs)
If Request("pr") = "1" Then
Me.Page.MasterPageFile = "print.master"
End If
End Sub
Here's a C# version:
protected void Page_PreInit(object sender, EventArgs e)
{
if (Request["pf"] == "1")
{
Page.MasterPageFile = "printfriendly.master";
}
}
Does this help?
Ken
Microsoft MVP [ASP.NET]
"sck10" <sc***@online.nospam> wrote in message
news:eH**************@TK2MSFTNGP03.phx.gbl...
Hello,
Currently I am using the following:
<%@ Page Language="VB" StylesheetTheme="Default"
MasterPageFile="~/template/mpColumn02.master" CodeFile="custrev.aspx.vb"
Inherits="custrev" title="Untitled Page" Trace="false" %>
Is there any way to pragmatically change the MasterPageFile? I need to
create a printer friendly link. With the link changing the MasterPageFile
from MasterPageFile01 to MasterPageFile02. Any help with this would be
appreciated...
--
Thanks in advance,
sck10