Both are code reduce features and reusability Purpose.When
we create Masterpage that is common to overall
project,whereas user controls these r used when we have
requirement on specific criteria.
Master page ex: INBOX,SPAM,DRAFT,TRASH etc in YAHOO WEBSITE
Master pages and user controils are two different concepts.
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
application.
Master has a conteact plceholder where u can put child page
in this cph.
when user control is uses with in page . u can not use any
page in user control
just a not :
this can be a tricky question depending on the interviewer.
Masterpage IS a UserControl, and you can easily check this
either by exploring classes to which websites are being
compiled or simply noting :
public class MasterPage : UserControl
semanticaly, use of classical UserControl and Masterpage is
of course different, but this already has been elaborated in
other answers
user control
1)it extension is .ascx.
2)it can be more than one on single web page.
3)it doesn't contain Contentplaceholder.
4)it doesn't work like a fixed template.it can be
display in diffrent manner in diffrent page.
MasterPage:
1) it extension is .Master.
2)it used like a template.
3)it contain ContentPlaceHolder.
Master page inherits all child pages in contentplace holder
and usercontrol can be placed in master page
user control is a control which must be placed in a page to
perform specific task
I look for the answer of this question too. I have project
in ASP.NET 1.1 in this project there is just one aspx. in
this page there is placeHolder and by client's reuqest page
loads different user controls into the placeHolder. the aspx
file likes MasterPage. now i converted the project into
ASP.NET 3.0. I don't know should i change the aspx file to
master and user controls to content pages or not??
In dotnet 1.1, developers where using user controls for the
website navigation, footers which were standard for all the
web pages, this was covered in 2.0 as master pages.
What is the maximum amount of memory any single process on
Windows can address? Is this different than the maximum
virtual memory for the system? How would this affect a
system design?
What definition correctly defines a label server control
with the name set to lblHoop?
a) <asp:Label name=?lblHoop? runat=?server? />
b) <Label id=?lblHoop? runat=?server? />
c) <asp:Label id=?lblHoop? runat=?server? />
d) <server label name=?lblHoop? runat=?asp? />