We will be undergoing scheduled maintenance on May 20th, 2013 at 02:00 GMT.
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Welcome to Understanding Master Pages. Now this is going to be a 2 part video and in Part 1 here I just want to draw you a little diagram so that you can get your head around what's happening with Master Pages and Content Pages. Because you need to get his down because there can be some more advanced things that come along later and dealing with these pages and if you got a good visual of this, then you got it. Let's start off with the Master Page. The Master Page and we'll do a diagram here and then I'll talk about some specifics a little bit later on in Part 2. But with the Master Page we're going to put the things on there that hardly ever change on the page and in this instance you'll notice we've got the Header and the Menu Areas. OK? So we're going to kind of lay those out on the Master Page and then we're going to put some Content Placeholders. Now, in this simple diagram I have only one here so I have Content Placeholder and there's only 1 Master Page at this point in my web app. Now I could have a whole bunch of other pages put there. Now my Content Pages are going to be what I normally see out there, like as Default ASPX and parts ASPX and so forth and the Default Content Page or the Content Page is going to have the data that I want to have appear in the Content Area here. And so the page directives at the top here are going to identify which Master Page this Content Page matches up with and so then when I build my application and it gets deployed and the page gets requested, they request this page right here. This page directive up here points to the Master Page, that content goes into there. Then what's rendered out to the server is a complete page with all the data in it. Now what is so neat about this, is that all I have to change are these pages out here where the content is and it will change every page where this particular content is. You'll see the same Master Layout but you'll see the contents change. So I'm going to create 1 Master Page that's going to give me my Header, my Menu, my Footer. I can do a right-side area, whatever I want. That will be consistent across, maybe I've got 300 Content Pages in my website. But I do is go put Custom Content in each one of those, point them to that Master and I'll have this 1 Master. Now when I get ready to make a change to my website, I want to make a change to the Header. I go make a change right here, I change the graphic, whatever, make them in this one place, in this one page and instantly all 300 Content Pages they got the change. Because in reality the Content Pages are simply linking this in. Almost, very, very similar really to the old server-side includes we used to do if you remember those. Now one other thing, what you're going to have and in the most Ð well in the Default Web Page and Websites that you have and the Visual Web Developer and Visual Studio, you actually have Multiple Content Placeholders. We'll talk about that in Part 2. But for now just get that visual. You have a Master Page that you build, you put Content Placeholders in the Master Page, then your Content Pages link to the Master Page right up here at the top. You'll tell it what Master Page to use with this content, the content gets pulled into the placeholders and you end up with a final page that the end-user sees in their browsers. So join me in Part 2, we'll jump into a few more of the technical details about the Master Pages.
| Course: | Designing and Developing ASP.NET 4 Web Apps (Exam 70-519) |
| Author: | Mark Long |
| SKU: | 34292 |
| ISBN: | 978-1-61866-029-9 |
| Release Date: | 2011-12-31 |
| Duration: | 8.5 hrs / 108 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |