473,386 Members | 1,598 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,386 software developers and data experts.

Using Master Pages and Base Pages

Don
I'm using master pages and have added some base functionality (public
functions) into this class.

I then create a new web form using the above as the master page. In the code
of my new web form, I need to access the custom PEMs of the Master page (I've
created).
I find only two ways of doing this (both of which i find unnecessary
replication of code)
- Make use of MasterType directive (which I'd have to do manually for each
and every page I create)
- Type caste the me.Master to the type required using CTYPE or DIRECTCAST or
the like.

Is there any other easier way of achieving the above?
I would've thought that there would be some setting in the web.config which
applies such a setting to all pages!
I'd hate to type either one of the above for each and every page i create
and use!
Sep 12 '06 #1
1 1741
Don,

I personally use the first technique you mention of settting the master type
on each page I create when I need this functionality.

That one little line doesn't seem too outrageous to add to each of my pages
as I create them...

The only other way to do this that I know of would be to inherit from a base
page class in the code behind each time you create a page. That is also only
one line of code, but would also have to be put into each page so setting
the master type seems much easier to me.
Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Don" <Do*@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
I'm using master pages and have added some base functionality (public
functions) into this class.

I then create a new web form using the above as the master page. In the
code
of my new web form, I need to access the custom PEMs of the Master page
(I've
created).
I find only two ways of doing this (both of which i find unnecessary
replication of code)
- Make use of MasterType directive (which I'd have to do manually for each
and every page I create)
- Type caste the me.Master to the type required using CTYPE or DIRECTCAST
or
the like.

Is there any other easier way of achieving the above?
I would've thought that there would be some setting in the web.config
which
applies such a setting to all pages!
I'd hate to type either one of the above for each and every page i create
and use!

Sep 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
1
by: yossimotro | last post by:
Hi, I have a server that only supports ASP.NET 1.1, as I understand master pages are available only from version 2.0. What can I use instead that is as elegant as master pages? Thanks, Yossi.
2
by: shapper | last post by:
Hello, I have 2 pages: Page1.aspx and Page2.aspx. The two pages have common design parts but also not common design parts. Is it possible to create something like this: MasterPageA |
1
by: shapper | last post by:
Hello, I am creating a web site with Nested Master pages. I also need to have a class where the culture is set. When the culture is changed by the user the page refreshes and the change takes...
3
by: Rich | last post by:
Hi, I want to use 2 master pages, one for the main part of the site, the other for the admin pages. They are quite similar, with many shared elements. Ideally I would like to have a parent...
11
by: Just Me | last post by:
I can see master pages being useful if one wants some fragil or complex web design which one does not want to have altered, but thats were it stops as far as I can see. Master Pages Plus 1.)...
4
by: Annie | last post by:
Hi guys, I am having a weired situation that don't know how to handle it ... I have master pages, the master page contains a dynaic menu which is set up in the database and has page url, name,...
0
by: jgdean14 | last post by:
Hi - We have an Early .NET 2.0 App that was created without Master Pages about a year ago. We opted for more of a MVC framework and dynamically- loaded User Controls. We use Custom User-Controls...
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
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: 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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.