Programmatic MasterPage access

C

cevans

Is there a way to load a MasterPage programmatically? Not switch a
page's masterpage but to create a MasterPage object that holds a given
masterpage. So I know I can do:

MasterPage master = new MasterPage();

But there is no way to do something like:

MasterPage master = new MasterPage("~/default.master");

So how does one create an instance of a given MasterPage???
 
C

Cowboy \(Gregory A. Beamer\)

Have not tried, but something like:

MasterPage master = new MasterPage();
master.MasterPageFile = "pathHere";

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 
C

Chris

That is an excellent site I spent a bit of time on there some months
back. But I did not see how to load and interact a MasterPage, just
how to assign a MasterPage etc. in the regular Page processing
lifecycle. If you saw something that displays what I am looking for
can you provide a more info please?

Thank you
 
C

Chris

I don't want to be pushy but I imagine that someone else has had to do
or try and do this. Any direction would be great!!!

Thank you.
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top