473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 4170
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
2
by: Steve Franks | last post by:
I am trying to access strongly typed properties in a page's master page from the content page. I followed an article that describes how to do this, and it seems quite straight forward. However...
8
by: PJ | last post by:
How can I get a reference to the master page class? It is defined as a partial class, but I cannot seem to type a variable to the name of the partial class? The compiler continually shows "The...
5
by: Federico | last post by:
I have a problem, I have an event declared in a Master Page, and I want to use in a Content Page holder of a Content Page. When I want to create the method to handle the event, I can njot reference...
2
by: Jon Spivey | last post by:
Hi, Using VS 2005/VB.net. I need to add a meta description tag and change a stylesheet link from a page based on a master page. Found this article...
1
by: Bob | last post by:
In ASP.NET 1.1, I had a class library with a bunch of base classes for all my projects. One of the base class is a base page class. In .NET 2.0, how can I compile a master page into a separate...
13
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas?...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.