Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2010, 08:25 AM
Authorized User
 
Join Date: Jun 2009
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default Master page

My project leader is saying that do not use master page to create common template but use user controls for that. Because master page has some disadvantages. But I think master page is more preferable than user controls. Please help me...
__________________
Happy coding...

Arnab Roy Chowdhury.
 
Old December 9th, 2010, 04:19 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you want a small repeating element of a page (such as a advert, or a login control) then you could use a User Control, however you would not use a user control to design a layout for the entire page as you cannot then embed the rest of your page inside the user control.

Master Pages probably do have their disadvantages, but they also have their advantages, so you need to work out if the advantages outweigh the disadvantages in your given scenario.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old December 21st, 2010, 01:41 AM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I would recommend bringing more of your specifics to this thread. It seems strange to me too, that you would consider using a user control to template a site. On the one hand, maybe you really do have a weird website that doesn't play well with master pages. But in general a master page is very similar to a user control, and in most cases where they differ, master pages tend to have the more flexible more straightforward means of implementing functionality. I guess I'm saying, I'd be surprised if user controls turn out to be the superior way for you to go.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old December 22nd, 2010, 09:12 AM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

you can use your own base page from which you can derive your pages.Please consider this feature it might help you.
 
Old December 22nd, 2010, 11:47 AM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

That's a good point. We've been talking about master pages (which make excellent page templates) and user controls (which make excellent modules) which are excellent ways to reuse XHTML (and the accompanying code to drive them, if any). However, a base page gives you a way to reuse C# code (or other language) throughout your website, and it's simpler to program against than C# code in a master page's code behind. You should note that a base page, being written in C#, is frequently not the best place to put page content though. If you need to output XHTML, a master page or a user control are usually better places to put it.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the Master page hoses site... Page 92... richv BOOK: Beginning SharePoint 2010 Development 19 December 30th, 2010 10:21 AM
access child page from Master page Gayathri79 ASP.NET 3.5 Basics 0 March 2nd, 2010 10:36 PM
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.