<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Master Pages, Themes and Navigation Controls</title><link>http://forums.asp.net/139.aspx</link><description>Discussions of MasterPages, Themes, and other page-related features. &lt;A href="http://aspadvice.com/SignUp/list.aspx?l=164&amp;amp;c=30" target=_blank&gt;Email List&lt;/A&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: A custom Page attribute, defined at top level</title><link>http://forums.asp.net/thread/1092275.aspx</link><pubDate>Mon, 24 Oct 2005 22:24:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1092275</guid><dc:creator>dabbi2005</dc:creator><author>dabbi2005</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1092275.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=1092275</wfw:commentRss><description>sorry was a little too fast to panic there, it's fixed and it's working. I actually found &lt;A href="http://weblogs.asp.net/scottgu/archive/2005/08/02/421405.aspx"&gt;some code &lt;/A&gt;where ScottGu describes the whole process by implementing a custom Page class. It surprised me in the comment section so few saw the potentials of this... In my case it's a great feature I've been trying to code for weeks! I can now change the image source for a "decoration image" in the masterpage from just one single Page attribute instead of 2-3 lines of code within each and every Page_Load section of the content pages. I love it!!</description></item><item><title>Re: A custom Page attribute, defined at top level</title><link>http://forums.asp.net/thread/1091904.aspx</link><pubDate>Mon, 24 Oct 2005 16:10:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1091904</guid><dc:creator>dannychen</dc:creator><author>dannychen</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1091904.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=1091904</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;table width="85%"&gt;&lt;tr&gt;&lt;td class="txt4"&gt;&lt;img src="/Themes/default/images/icon-quote.gif"&gt;&amp;nbsp;&lt;strong&gt;dabbi2005 wrote:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="quoteTable"&gt;&lt;table width="100%"&gt;&lt;tr&gt;&lt;td width="100%" valign="top" class="txt4"&gt; 
&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT size=3&gt;&lt;BR&gt;&lt;BR&gt;In Default.aspx codebehind I put:&lt;BR&gt;&lt;FONT color=#0000ff&gt;public partial class&amp;nbsp;_Default : System.Web.UI.Page&lt;BR&gt;{ ... }&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;And so set for the same Default.aspx page:&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~/masterpage.master" CodeFile="Default.aspx.cs" Inherits="_Default" DecorationImage="roses" %&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;Well this stops me already at compilation level, VS says there is no such attribute defined!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;This is where you strayed from my example.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;First:&amp;nbsp; You need to inherits from the baseclass:&lt;BR&gt;&lt;BR&gt;public partial class _Default : &lt;STRONG&gt;BaseClass&lt;BR&gt;&lt;BR&gt;&lt;/STRONG&gt;Second: You need to specify a CodeFileBaseClass attribute on your page directive: &lt;BR&gt;&lt;BR&gt;&amp;lt;%@ Page .... CodeFileBaseClass="BaseClass" %&amp;gt;&lt;BR&gt;&lt;BR&gt;--&lt;BR&gt;Danny</description></item><item><title>Re: A custom Page attribute, defined at top level</title><link>http://forums.asp.net/thread/1090420.aspx</link><pubDate>Fri, 21 Oct 2005 21:13:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1090420</guid><dc:creator>dabbi2005</dc:creator><author>dabbi2005</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1090420.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=1090420</wfw:commentRss><description>&lt;P&gt;thx very much altough I still haven't got it working. Actually I'm using C# and the attribute I want to add is to the Page control so I've tried:&lt;BR&gt;&lt;FONT size=1&gt;&lt;BR&gt;&lt;FONT size=3&gt;In App_Code/BaseClass.cs I put:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;public class BaseClass : System.Web.UI.Page&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; public string DecorationImage;&lt;BR&gt;}&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;In Default.aspx codebehind I put:&lt;BR&gt;&lt;FONT color=#0000ff&gt;public partial class&amp;nbsp;_Default : System.Web.UI.Page&lt;BR&gt;{ ... }&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;And so set for the same Default.aspx page:&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~/masterpage.master" CodeFile="Default.aspx.cs" Inherits="_Default" DecorationImage="roses" %&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;Well this stops me already at compilation level, VS says there is no such attribute defined!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>Re: A custom Page attribute, defined at top level</title><link>http://forums.asp.net/thread/1090002.aspx</link><pubDate>Fri, 21 Oct 2005 15:12:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1090002</guid><dc:creator>dannychen</dc:creator><author>dannychen</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1090002.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=1090002</wfw:commentRss><description>&lt;P&gt;Yes.&amp;nbsp; If you have a baseclass that you inherit, you can put properties in there that can be specified on the directive.&amp;nbsp; This does not work for properties in the CodeBehind classes or&amp;nbsp;declared on the page&amp;nbsp;although the CodeBehind class can inherit from this baseclass.&amp;nbsp; This work on&amp;nbsp;the same for Pages but I'll show MasterPages since you requested it.&amp;nbsp; Example:&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;App_Code/BaseClass.vb:&lt;BR&gt;&lt;BR&gt;Public Class BaseClass&lt;BR&gt;&amp;nbsp; Inherits MasterPage&lt;BR&gt;&lt;BR&gt;&amp;nbsp; Public Property Test() As String&lt;BR&gt;&amp;nbsp; &amp;nbsp;...&lt;BR&gt;&amp;nbsp; End Property&lt;BR&gt;&lt;BR&gt;End Class&lt;BR&gt;&lt;BR&gt;Single File Master Page:&lt;BR&gt;&amp;lt;%@ Master Language="VB" Inherits="BaseClass" Test="This is some text" %&amp;gt;&lt;BR&gt;&lt;BR&gt;CodeBehind MasterPage:&lt;BR&gt;&amp;lt;%@ Master Language="VB" CodeFile="master.master.vb" CodeFileBaseClass="BaseClass" Inherits="Master" Test="This is some text"&amp;nbsp;%&amp;gt;&lt;BR&gt;&lt;BR&gt;master.master.vb:&lt;BR&gt;&lt;BR&gt;Public Class Master&lt;BR&gt;&amp;nbsp; Inherits BaseClass&lt;BR&gt;End Class&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Let me know if this is what you want!&lt;BR&gt;--&lt;BR&gt;Danny&lt;/P&gt;</description></item><item><title>A custom Page attribute, defined at top level</title><link>http://forums.asp.net/thread/1089528.aspx</link><pubDate>Fri, 21 Oct 2005 02:21:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1089528</guid><dc:creator>dabbi2005</dc:creator><author>dabbi2005</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1089528.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=139&amp;PostID=1089528</wfw:commentRss><description>&lt;P&gt;Is there any custom attribute (property) I can set at the @Page declaration syntax for the Master page to read and parse?&lt;BR&gt;&lt;FONT color=#800000&gt;&lt;BR&gt;The Masterpage renders a particular image for every page but I want to be able to set a custom image or just disable it easily in some specific pages and so the Masterpage code-behind would read that particular attribute value and set the image properties accordingly...&lt;/P&gt;&lt;/FONT&gt;</description></item></channel></rss>