Forums » .NET » ASP.NET »

Master pages vs user control

Posted Date: 25 Jul 2009      Posted By:: Ali     Member Level: Gold    Member Rank: 579     Points: 1   Responses: 5

I still did not get the difference between in user control & master pages,where i need user control but not master page & where i can use master pages but not user control,

I read in many places that i can use login control in user control but i think i can use login control by master page ?

also read t hat master page is a template so what is user control?isnot it?


#406873    Author: anita singh      Member Level: Gold      Member Rank: 234     Date: 25/Jul/2009   Rating: 2 out of 52 out of 5     Points: 2

Master pages are used to provide the consistent layout and
common behaviour for multiple pages in your
applications.then u can add the Contenetplaceholder to add
child pages custom contenet.
User Controls:Sometimes u need the functionality in ur web
pages which is not possible using the Built-In Web server
controls then user can create his own controls called user
controls using builtin controls.User controlsn are
those with .aspx extensions and u can share it in the

#406876    Author: Pravin S. Shrirao      Member Level: Gold      Member Rank: 0     Date: 25/Jul/2009   Rating: 2 out of 52 out of 5     Points: 2

Master Page has a concept of page and user control is nothing but a control. Master page gives group of pages a common header layout and also has a facility to add the contents in that page. Previousply we need to do a lot of work in order to implement this but with master page we only have to specify master page name and we will get master page layout in a page. we can put user controls on master pages.

You can see in every web site some part is constant in all pages only contents are different. we can layout this common part in master page and in contents we can show the page specific part. when user request this content page it get merged with the master page and we will view the outout page as combination of these 2.

Thanks & regards
Pravin shrirao

#406877    Author: Ramesh S      Member Level: Gold      Member Rank: 106     Date: 25/Jul/2009   Rating: 2 out of 52 out of 5     Points: 2

User control - Assume that you have some common user interface functionality which is required in some of your pages. Then create that user interface as User Control and use it in the required pages.

Master Page - Assume that your application has a header and a footer in all the pages. Also assume that the user interface layout of your page like left side panel, menus are common to all pages, then you can use master pages.

Thanks & Regards
Ramesh. S

#406878    Author: lakshmi      Member Level: Bronze      Member Rank: 0     Date: 25/Jul/2009   Rating: 2 out of 52 out of 5     Points: 2

Master pages has a content placeholder where u can place other controls.
wheras in usercontrol we cannot use other controls just create new control for our reqirements.

#406903    Author: Ali      Member Level: Gold      Member Rank: 579     Date: 25/Jul/2009   Rating: 2 out of 52 out of 5     Points: 2

I can just think that user control is a control which is not a built in control,but MP is a page etc...... ,is this right ?

this is not a difference UC is for many pages & MP for all,i can we can use vice versa?I can use menu in UC, i can also use UC instead of master pages for footer & header. And some kind of functionally can also be done MP .

I want to know what is the need where UC fail & MP pass,& where MP pass & UC fail.

Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.

Return to Discussion Forum
Start new thread

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India