By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Are Master Pages Really Worth The Effort ?

P: n/a
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.) Consistent Design.
Master Pages Minus

1.) Makes it difficult to access properties or function on the Master, one
has to either use FindControl or has to cast to the appropriate type in
order to gain access.

2.) ID's on the content page become ctl_theplaceholderName_originalID. this
means that style sheets get messy when trying to group id's in a common
class. ( this is the way user controls work anyway, but I would have thought
that It would have been possible to check the ID's were not in use in the
master and allow them to remain as originally names in case of no
duplicates.?!? or at least give that as an option ?

IE

form#FormName .groupingClass #ctl_theplaceholderName_originalID{}

instead of

form#FormName .groupingClass #originalID {}

Comments, im sure I have missed loads of positives, but I would like
discussion on this please.

Thanks
Feb 21 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
you master page should implement an interface (or multiple). you pages
should all have a base page. the base page can expose a properly cast
master. it all about object oriented design. in the .net world you
should follow the interface design also.

-- bruce (sqlwork.com)

Just Me wrote:
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.) Consistent Design.
Master Pages Minus

1.) Makes it difficult to access properties or function on the Master, one
has to either use FindControl or has to cast to the appropriate type in
order to gain access.

2.) ID's on the content page become ctl_theplaceholderName_originalID. this
means that style sheets get messy when trying to group id's in a common
class. ( this is the way user controls work anyway, but I would have thought
that It would have been possible to check the ID's were not in use in the
master and allow them to remain as originally names in case of no
duplicates.?!? or at least give that as an option ?

IE

form#FormName .groupingClass #ctl_theplaceholderName_originalID{}

instead of

form#FormName .groupingClass #originalID {}

Comments, im sure I have missed loads of positives, but I would like
discussion on this please.

Thanks

Feb 21 '07 #2

P: n/a
Hello Just Me" news.microsoft.com,
JI can see master pages being useful if one wants some fragil or
Jcomplex web design which one does not want to have altered, but thats
Jwere it stops as far as I can see.
J>
JMaster Pages Plus
J>
J1.) Consistent Design.
J>
JMaster Pages Minus
J>
J1.) Makes it difficult to access properties or function on the
JMaster, one has to either use FindControl or has to cast to the
Jappropriate type in order to gain access.

You can use event-driver approach for this, making interactions loosely coupled

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Feb 21 '07 #3

P: n/a
Yes, I know how to set the master type and cast it, but it still means that
you you need to have at least one function in the content page in order to
avoid casting each time.

"bruce barker" <no****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
you master page should implement an interface (or multiple). you pages
should all have a base page. the base page can expose a properly cast
master. it all about object oriented design. in the .net world you should
follow the interface design also.

-- bruce (sqlwork.com)

Just Me wrote:
>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.) Consistent Design.
Master Pages Minus

1.) Makes it difficult to access properties or function on the Master,
one has to either use FindControl or has to cast to the appropriate type
in order to gain access.

2.) ID's on the content page become ctl_theplaceholderName_originalID.
this means that style sheets get messy when trying to group id's in a
common class. ( this is the way user controls work anyway, but I would
have thought that It would have been possible to check the ID's were not
in use in the master and allow them to remain as originally names in case
of no duplicates.?!? or at least give that as an option ?

IE

form#FormName .groupingClass #ctl_theplaceholderName_originalID{}

instead of

form#FormName .groupingClass #originalID {}

Comments, im sure I have missed loads of positives, but I would like
discussion on this please.

Thanks

Feb 21 '07 #4

P: n/a
An example please ?

You can use event-driver approach for this, making interactions loosely
coupled

Feb 21 '07 #5

P: n/a
Hello Just Me" news.microsoft.com,

See there http://aspnet.4guysfromrolla.com/articles/013107-1.aspx

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

JAn example please ?
J>
>You can use event-driver approach for this, making interactions
loosely coupled

Feb 21 '07 #6

P: n/a
"bruce barker" <no****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
you master page should implement an interface (or multiple).
Yes indeed.
you pages should all have a base page. the base page can expose a properly
cast master. it all about object oriented design.
Absolutely! That's the crucial element.
Feb 21 '07 #7

P: n/a
Hi there,

DO NOT use client id in CSS stylesheet for any server control- NEVER!!!. It
is not quaranteed renered client id is the same as ID. Use named classes
instead. in addtion, you don't have to cast master property everytime you
access it as you can add @MasterType directive to every web form that has a
master page.

--
Milosz
"Just Me" wrote:
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.) Consistent Design.
Master Pages Minus

1.) Makes it difficult to access properties or function on the Master, one
has to either use FindControl or has to cast to the appropriate type in
order to gain access.

2.) ID's on the content page become ctl_theplaceholderName_originalID. this
means that style sheets get messy when trying to group id's in a common
class. ( this is the way user controls work anyway, but I would have thought
that It would have been possible to check the ID's were not in use in the
master and allow them to remain as originally names in case of no
duplicates.?!? or at least give that as an option ?

IE

form#FormName .groupingClass #ctl_theplaceholderName_originalID{}

instead of

form#FormName .groupingClass #originalID {}

Comments, im sure I have missed loads of positives, but I would like
discussion on this please.

Thanks
Feb 21 '07 #8

P: n/a
You can use style sheets, I have done it. You simply assign the css class
instead of using ID selectors.
"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.plwrote in message
news:A2**********************************@microsof t.com...
Hi there,

DO NOT use client id in CSS stylesheet for any server control- NEVER!!!.
It
is not quaranteed renered client id is the same as ID. Use named classes
instead. in addtion, you don't have to cast master property everytime you
access it as you can add @MasterType directive to every web form that has
a
master page.

--
Milosz
"Just Me" wrote:
>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.) Consistent Design.
Master Pages Minus

1.) Makes it difficult to access properties or function on the Master,
one
has to either use FindControl or has to cast to the appropriate type in
order to gain access.

2.) ID's on the content page become ctl_theplaceholderName_originalID.
this
means that style sheets get messy when trying to group id's in a common
class. ( this is the way user controls work anyway, but I would have
thought
that It would have been possible to check the ID's were not in use in the
master and allow them to remain as originally names in case of no
duplicates.?!? or at least give that as an option ?

IE

form#FormName .groupingClass #ctl_theplaceholderName_originalID{}

instead of

form#FormName .groupingClass #originalID {}

Comments, im sure I have missed loads of positives, but I would like
discussion on this please.

Thanks

Feb 22 '07 #9

P: n/a
Thus wrote Just Me" news.microsoft.com,
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.) Consistent Design.

Master Pages Minus

1.) Makes it difficult to access properties or function on the Master,
one has to either use FindControl or has to cast to the appropriate
type in order to gain access.
You can have strongly typed MasterPages -- use <%@MasterType VirtualPath="..."
%to reference your MasterPage by URI, or <%@MasterType TypeName="..." %>
to do it by CLR type.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Feb 22 '07 #10

P: n/a
Thanks Joerg

"Joerg Jooss" <ne********@joergjooss.dewrote in message
news:94**************************@msnews.microsoft .com...
Thus wrote Just Me" news.microsoft.com,
>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.) Consistent Design.

Master Pages Minus

1.) Makes it difficult to access properties or function on the Master,
one has to either use FindControl or has to cast to the appropriate
type in order to gain access.

You can have strongly typed MasterPages -- use <%@MasterType
VirtualPath="..." %to reference your MasterPage by URI, or <%@MasterType
TypeName="..." %to do it by CLR type.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de


Feb 22 '07 #11

P: n/a
That's exactly what i said :D you shouldn't use control.ID

<asp:TextBox runat=sever ID=txtName/>

#txtName {
width: 100px;
}

but named classes

..MyCssClassName{
width: 100px;
}

<asp:TextBox runat=sever ID=txtName CssClass="MyCssClassName"/>
--
Milosz
"Just Me" wrote:
You can use style sheets, I have done it. You simply assign the css class
instead of using ID selectors.
"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.plwrote in message
news:A2**********************************@microsof t.com...
Hi there,

DO NOT use client id in CSS stylesheet for any server control- NEVER!!!.
It
is not quaranteed renered client id is the same as ID. Use named classes
instead. in addtion, you don't have to cast master property everytime you
access it as you can add @MasterType directive to every web form that has
a
master page.

--
Milosz
"Just Me" wrote:
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.) Consistent Design.
Master Pages Minus

1.) Makes it difficult to access properties or function on the Master,
one
has to either use FindControl or has to cast to the appropriate type in
order to gain access.

2.) ID's on the content page become ctl_theplaceholderName_originalID.
this
means that style sheets get messy when trying to group id's in a common
class. ( this is the way user controls work anyway, but I would have
thought
that It would have been possible to check the ID's were not in use in the
master and allow them to remain as originally names in case of no
duplicates.?!? or at least give that as an option ?

IE

form#FormName .groupingClass #ctl_theplaceholderName_originalID{}

instead of

form#FormName .groupingClass #originalID {}

Comments, im sure I have missed loads of positives, but I would like
discussion on this please.

Thanks


Feb 24 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.