Master pages vs user control
Posted Date: 25 Jul 2009 Posted By:: Ali Member Level: Gold Member Rank: 105 Points: 1
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: 60 Date: 25/Jul/2009 Rating: 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 asp.net 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: 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
|#406877 Author: Ramesh S Member Level: Gold Member Rank: 0 Date: 25/Jul/2009 Rating: 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
|#406878 Author: lakshmi Member Level: Bronze Member Rank: 0 Date: 25/Jul/2009 Rating: 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: 105 Date: 25/Jul/2009 Rating: 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.
| ||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.