<%@ page language="C#" MasterPageFile="main.master" printcontent:MasterPageFile="print.master" %>
<script runat="server" language="c#">
public override bool TestDeviceFilter(string deviceFilterName) {
if (deviceFilterName.Equals("printcontent")) {
if (this.Request.QueryString["print"] != null) {
return true;
}
}
return base.TestDeviceFilter(deviceFilterName);
}
</script>
<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="server">
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test<br />
<br />
<asp:hyperlink id="HyperLink1" runat="server" navigateurl="TwoMasterPages.aspx?print=1">Print
me!</asp:hyperlink>
</asp:content>
<%-- main.master
<%@ master language="C#" %>
<script runat="server">
</script>
<html>
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form runat="server">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</form>
</body>
</html>
--%>
<%-- print.master
<%@ master language="C#" %>
<script runat="server">
</script>
<html>
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form runat="server">
This master can be used for printing.<br />
<br />
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</form>
</body>
</html>
--%>