Referring to partial classes from MasterPage

D

David Adams

Hi,

I have a dilemma that I was able to handle previously with ASP.NET 1.1. I
have a MasterPage that has an image which changes depending on the currently
loaded .aspx page. I used to do something like this in 1.1 within the
UserControl:

if (this.NamingContainer is agents)
imgHeader.ImageUrl="images\agents.gif";
else if (this.NamingContainer is managers)
imgHeader.ImageUrl="images\agents.gif";

Now, within the MasterPage, I cannot refer to a partial class (apparently)
like I did above - specifically I cannot say:

if (this.ContentPlaceHolder.Page is agents) // partial class not available
imgHeader.ImageUrl="images\agents.gif";

Is there a way I can refer to the type of a partial class?

This would also be helpful if I am exposing properties in the partial class.

Thanks,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,137
Messages
2,570,795
Members
47,342
Latest member
eixataze

Latest Threads

Top