473,287 Members | 1,964 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,287 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 4164
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.