Referencing Master Page from a Web Control

P

PJ

I am trying to get reference to a Master page from a web user control.
However, I cannot seem to even access the type. I have been referencing the
master page in forms by declaring the master attribute atop the .aspx page.
This works fine, but this attribute is not recognized in controls.

Thanks
~PJ
 
C

Christopher Reed

Try using Page.Master as your reference to the Master page, as long as the
MasterType directive is in your ASPX file. I haven't tried myself, but it
seems logical.
 
P

PJ

Yes, but then I would have to cast it. And again, for some reason I can't
even reference the type.
 
C

Christopher Reed

You might try using a common namespace for everything (Master page, page,
user control) and see if this helps.
 

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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top