views:

150

answers:

2

pls tell about difference between master page and aspx page

i need exact difference shortly, if u know pls, i refered so many website and books but i can't get it.

+2  A: 

In essence you use master pages to define the base design of a webpage, and have the aspx pages inherit parts of the master pages design. Perhaps you have a master page with a banner up to, and a content definition below it. All aspx pages using the master page, inherit the top banner.

ASP.NET Master pages from MSDN

ASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

Perhaps you should do your own homework?

Dominic Bou-Samra
* do your homework yourself
abatishchev
+1  A: 

A master page is a template for inserting content into. Technically, a master page is nothing more than a server control that gets grafted into the control tree of a page. Generally speaking, you can add:

<asp:ContentPlaceHolder ID="MainContent" runat="server" />

Into a master page, and

<asp:Content runat="server" ContentPlaceHolderID="MainContent">Here is my content</asp:Content>

And the net result is you are inserting your text "Here is my content" into the master page. Technically though, you are inserting the master page into your page, and then inserting your content back into the master page.

All part of the fun of control trees :)

Matthew Abbott