locked
Header And Footer On All Web Pages RRS feed

  • Question

  • Folks, Is there a way to create a header and footer to appear on each web page I design?

    I have done this in ASP.Net web application with Master Pages using Visual Studio however I wanted to know does expression web have something similar?

    Tuesday, September 21, 2010 3:14 AM

Answers

  • That is how DWTs work. The non-editable content in the DWT is added to your pages when the DWT is attached. The unique content in your pages goes into editable regions defined in the DWT.

    asp.NET master pages are added to your content on the server, as the page is served. The page consists only of the "editable" regions in the master page.

    In my opinion, if you use asp.NET, then use master pages.  You only have to upload the page content for an edited page, or just the master page (not the entire site) for a change in the master page.


    Ron Symonds
    Microsoft MVP (Expression Web)

    www.rxs-enterprises.org/fp
    • Marked as answer by FogHorn I Tuesday, September 21, 2010 11:15 AM
    Tuesday, September 21, 2010 9:08 AM

All replies

  • EW can use master pages if the site uses dotnet or for html sites use DWTs - dynamic web templates.

    Try out the new expressionwebforum.com


    MS MVP Expression Tutorials & Help http://by-expression.com & Expression Web forums
    Tuesday, September 21, 2010 3:26 AM
  • Thanks Cheryl.

    I have followed some simple intsructions on how to create a DWT.

    I then attached the DWT to my Home.html we page and I have realised that when you do this it actually places the entire content of the DWT into my home webpage. Is that wha is supposed to happen as in Master Pages with ASP.NET it just has a reference on the page tag at the top.

    I'm a litlle confused.

    Tuesday, September 21, 2010 4:41 AM
  • That is how DWTs work. The non-editable content in the DWT is added to your pages when the DWT is attached. The unique content in your pages goes into editable regions defined in the DWT.

    asp.NET master pages are added to your content on the server, as the page is served. The page consists only of the "editable" regions in the master page.

    In my opinion, if you use asp.NET, then use master pages.  You only have to upload the page content for an edited page, or just the master page (not the entire site) for a change in the master page.


    Ron Symonds
    Microsoft MVP (Expression Web)

    www.rxs-enterprises.org/fp
    • Marked as answer by FogHorn I Tuesday, September 21, 2010 11:15 AM
    Tuesday, September 21, 2010 9:08 AM
  • Hi _Ronx,

    So for every page I wish to attach a DWT, the entire DWT is copied to the web page? Thats so dissappointing that Microsoft have done it like this.

    I usually develop in Visual Studio in ASP.NET and I'm trying out Expression Web to see what it can offer as some of my web sites I develop don't make Database Calls to an SQL Server etc.. they are simply pure HTML with CSS.

    I get the feeling that Expression Web doesn't really offer very much at all, I was hoping to spruce up we sites with Expression Web.

    Tuesday, September 21, 2010 9:20 AM
  • This is not something Microsoft has done per se. It's the way DWTs work.

    There are two scenarios for having site wide common content like headers and footers; design time methods like DWTs and FP type 'include' pages, and server side like ASP.Net MasterPages or asp/php/ssi includes.

    The design time tools all mean you need to publish the entire site each time you make a change; the server side methods mean you only publish the common content if you change it.

    If you want the latter, then ASP.Net MasterPages are you best bet, even if you don't have db driven content. EW is perfectly able to handle these MasterPages and gives you a number of design tools that aren't available in Visual Studio.


    Ian Haynes

    EW V4 Add-Ins
    EW resources, hints and tips
    Tuesday, September 21, 2010 10:02 AM
  • Ok I undestand what your saying.

    Can you mix and match ASP.NET Pages with just HTML Pages?

    In other words, if I design a html page and a ASP.NET Master page, can you reference the ASP.NET Master Page in the HTML Page? or do you hve to use ASP.NET only to refernece a Master Page?

    Tuesday, September 21, 2010 10:40 AM
  • You can mix html and asp.net pages on the same site but ASP.Net MasterPages can only be used with ASP.Net pages, not html pages. It is best to stick to one or the other.
    Ian Haynes

    EW V4 Add-Ins
    EW resources, hints and tips
    Tuesday, September 21, 2010 11:07 AM
  • Ok thanks Ian. I will resort back to ASP.NET and ASP.NET Master Pages.

    I'm not convinced with DWT's.

    Cheers.

    Tuesday, September 21, 2010 11:14 AM
  • DWTs have their place. It perhaps depends how frequently you change the header and footer and would need to republish the whole site.
    Ian Haynes

    EW V4 Add-Ins
    EW resources, hints and tips
    Tuesday, September 21, 2010 11:24 AM
  • Master Pages work server side and require that the hosting server support asp.net. DWTs are server independent and do not require any support on the host. This is the primary difference between the two.

    If you host supports it you can use server side includes instead of DWTs but you may not see the included content in design view like you do with master pages or with pages attached to a dwt.

    You can mix html & asp.net pages but they would all have to have an aspx file extension if you wished to use master pages wtih html pages.


     Try out the new expressionwebforum.com


    MS MVP Expression Tutorials & Help http://by-expression.com & Expression Web forums
    Tuesday, September 21, 2010 2:21 PM
  • "So for every page I wish to attach a DWT, the entire DWT is copied to the web page? "

    The entire Non-editable content is copied from the DWT.  That's what it is for: your header, your footer, maybe a site-wide menu, etc..

    The Editable regions are where your individual page content goes.  Attaching a new DWT to already completed pages is not something I normally do. It takes care: you have to have the existing page organized such that you can map the non-editable and editable regions in the DWT to new and existing areas on the existing pages, when you attach it.

    If you do that properly, the new, for example, non-editable "header" region in your DWT will be added to the existing page, while you will map the existing content on the page to, say, the DWT's editable "main content" region.

    In concept, this is not much different from a Master page.  The biggest difference is where the pages are combined (server side for Master pages, locally, design-side, for DWTs).

    Tuesday, September 21, 2010 4:03 PM