Monday, March 26, 2012

Design approaches, AJAX of Master pages


Hello !

I'm migrating a website, all done with frames, from VS2003 to VS2005.
The layout of the website is a classical three columns with a header and a footer.

I want to remove frames but I would like advice on wether to use Master page or only AJAX.

Using AJAX, I would have one main page with the header and left column, clicking options on it
would load a HTML, CSS and javascript in the center column.
Fast and responsive but maybe hard to maintain and test.

Using a Master page, I guess I would have less changes to do since all the placeholders of the master page
would now be set as children of the master page. I haven't used Master pages yet so maybe
I don't understand the technology correctly.

Does anyone had the same concerns?
Can anyone tell me the pros and cons of this ?
Should I use a mix of the two approaches ?

My english is not perfect and I'm sorry for that, don't hesitate to ask for clearer details.

Thanks for any help !
Claude

You are correct - you do not understand the pratice of master pages correctly.

Masterpages in the Visual Studio 2005 enviroment are design time only. They are used as a way to manage a single layout across multiple content pages. When your site is complied or rendered, you end up with 1 page only. Masterpages should not be confused with frames in any way shape or form, they are not the same technology at all.

To understand this better - basically what you are doing is defining your layout, graphics, wrappers...etc in a master page. This is to maintain consistancy across all pages that would incorporate the design of that master page. So you can imagine a top header, a left column with links, and a center content area that you'd leave blank. In your content pages, you'd create the elements required to render content in that center area, without having to redesign, or duplicate the top and left column on each page. This is DESIGN TIME only.

When the pages are created and rendered. It'd be exactaly the same as designing your layout on each and every page. The pages are combined and sent down to the browser as a single html page, and nobody is the wiser.

To answer you're question. You should use Master Pages, AND javascript and Css (if thats your chosen technology) to render your pages. Using Masterpages for your layouts, and javascript css to render the center areas.

Master pages are "templates" that you build content pages around. They are not render time "frames".

No comments:

Post a Comment