468,511 Members | 1,680 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,511 developers. It's quick & easy.

Master Page In Class Library

We currently have a 1.1 class library which houses the look and feel of our
website by creating the html form dynamically in a base class. We then
distribute our assembly to other application development teams to use so they
have the standard enterprise wide look and feel and only have to worry about
the business functionality of their specific app.

Now comes ASP.Net 2.0 and master pages. It sounded like a great way to make
a template that we could distribute via an assembly (DLL) to the enterprise
so they could continue just inherit the master page and not worry about the
look and style of their apps. However, I can't seem to find a way to
incorporate the master page into a class library. When you create a class
library you don't even have an option to add a master page. Am I missing
something or do we have to stick to the way we were doing it in 1.1? Are
master pages only allowed in a web application project?
May 15 '06 #1
5 3939
Hi,

Thank you for posting.

Based on my understanding, there's no easy way to just release a compiled
assembly which contains master pages and let the website use them.

But you can compile the code-behind classes of master pages into a separate
assembly and release those *.master files and the assembly.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 16 '06 #2
But I can't just use the code-behind classes because the actual layout will
be in the master.aspx page...correct ? Doesn't sound like we can use master
pages. I know the way we are building the layout in our current 1.1 assembly
still works in 2.0. I was just hoping there was a way we could take
advantage of the new functionality but I guess we will stick with what we
have. Thanks for your help.
May 16 '06 #3
I do not have a solution, but perhaps a few clues:
A master page is a user control. If you want to create the GUI bits in pure
code and compile, you can have a "master page" that is precompiled. I am not
sure how much of a savings this would have over offering a server control
that slaps into a master page in the different apps. It is also going to be
a tricky road, as you are the pioneer in this effort (at least I know of
nobody who has done this before).

Reflecting the MS classes may give you an option. Optionally, you can create
a code snippet that represents the master page (yeah, it is a cheap option
with the downside of still having to update in multiple places if you change
your mind).

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Kevin" <pa***@newsgroup.nospam> wrote in message
news:47**********************************@microsof t.com...
We currently have a 1.1 class library which houses the look and feel of
our
website by creating the html form dynamically in a base class. We then
distribute our assembly to other application development teams to use so
they
have the standard enterprise wide look and feel and only have to worry
about
the business functionality of their specific app.

Now comes ASP.Net 2.0 and master pages. It sounded like a great way to
make
a template that we could distribute via an assembly (DLL) to the
enterprise
so they could continue just inherit the master page and not worry about
the
look and style of their apps. However, I can't seem to find a way to
incorporate the master page into a class library. When you create a class
library you don't even have an option to add a master page. Am I missing
something or do we have to stick to the way we were doing it in 1.1? Are
master pages only allowed in a web application project?

May 16 '06 #4
You mentioned a master page as a control and it created another question in
my mind. Can we create a master page in a web app and have it compiled as
it's own custom/user control that we can distribute ? The key would be to
keep it locked down so other developers couldn't change any of the master
pages functionality or cosmetics but they could still incorporate the control
into their web applications and set their own webpages to inherit from the
master page control we gave them.
"Cowboy (Gregory A. Beamer)" wrote:
I do not have a solution, but perhaps a few clues:
A master page is a user control. If you want to create the GUI bits in pure
code and compile, you can have a "master page" that is precompiled. I am not
sure how much of a savings this would have over offering a server control
that slaps into a master page in the different apps. It is also going to be
a tricky road, as you are the pioneer in this effort (at least I know of
nobody who has done this before).

Reflecting the MS classes may give you an option. Optionally, you can create
a code snippet that represents the master page (yeah, it is a cheap option
with the downside of still having to update in multiple places if you change
your mind).

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Kevin" <pa***@newsgroup.nospam> wrote in message
news:47**********************************@microsof t.com...
We currently have a 1.1 class library which houses the look and feel of
our
website by creating the html form dynamically in a base class. We then
distribute our assembly to other application development teams to use so
they
have the standard enterprise wide look and feel and only have to worry
about
the business functionality of their specific app.

Now comes ASP.Net 2.0 and master pages. It sounded like a great way to
make
a template that we could distribute via an assembly (DLL) to the
enterprise
so they could continue just inherit the master page and not worry about
the
look and style of their apps. However, I can't seem to find a way to
incorporate the master page into a class library. When you create a class
library you don't even have an option to add a master page. Am I missing
something or do we have to stick to the way we were doing it in 1.1? Are
master pages only allowed in a web application project?


May 16 '06 #5
Since the property MasterPageFile is a url which need to point to an
existing master page file, I think other websites simply cannot work with
master pages without releasing the source code of master page files.
Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 19 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Michael Herman \(Parallelspace\) | last post: by
2 posts views Thread by Steve Franks | last post: by
8 posts views Thread by PJ | last post: by
2 posts views Thread by Jon Spivey | last post: by
4 posts views Thread by Boris Yeltsin | last post: by
10 posts views Thread by =?Utf-8?B?RGFuaQ==?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.