crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Different between MasterPages and UserControl
Question Posted on 06 Mar 2019Home >> DotNet >> ASP.NET >> Different between MasterPages and UserControl

Different between MasterPages and UserControl
Both of these provide a common design which is used in .aspx pages. We can pass data from both of this to .aspx pages and viceversa.

MasterPage:-(1)Files in master page have .Master extension which is comes in ASP.NET 2.0. It has code file master.cs or master.vb extension. And this can use all toolbox controls.
UserControl:-(1) This have .ascx extension. And code files are .aspx.cs or .ascx.vb. And this can use all toolbox controls.


MasterPage:-(2)This have a control name ContentPlaceHolder which have a storage location where we can put out contents of .aspx page. Common part for pages will be outside of ContentPlaceHolder. It can be increase or decrease as per our needs.
UserControl:-(2)This doesnot have any ContentPlaceHolder control so layout of this have some difficult in providing proper layout and alignment for large designs.

MasterPage:-(3)We need to add MasterPageFile attribute in the page directive of the .aspx page. The .aspxpage that uses the master page is known as content page.
UserControl:-(3)When we drag and drop a user control on page it is automatically Register and a Register Tag is added.

MasterPage:-(4)We can refernce using Web.Config file and we can do dynamically by writing code in preInit event.
UserControl:-(4)Can be attached dynamically using LoadControl method.

MasterPage:-(5)More suitable for large designs
UserControl:-(5)Suitable for small design

And one of main difference is thet we use UserControl in MasterPages. But MasterPages cannot be used in User Controls.
0
0



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

Use of Calendar control in dotnet with code

How to improve Front End UI performance of dotnet web application?

File upload in dotnet

reverse a string

function of garbage collector






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap