DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

'Dynamic' Master Pages

This is a discussion on 'Dynamic' Master Pages within the .Net Development forums, part of the Programming & Scripting category; OK, I need help wrapping my brain around this. Perhaps y'all can nudge my brain in a different direction. I ...

Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

  #1  
Old August 13th, 2008, 02:50 PM
Wolffy's Avatar
Slaprentice of Wolves

 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 392
Thanks: 7
Thanked 58 Times in 51 Posts
Blog Entries: 1
Rep Power: 4
Wolffy is a jewel in the roughWolffy is a jewel in the roughWolffy is a jewel in the rough
Default 'Dynamic' Master Pages

OK, I need help wrapping my brain around this. Perhaps y'all can nudge my brain in a different direction.

I have two websites for clients that I support -- let's say they happen to sell books; JungleRiver.com and ShedsAndRoyal.com.
Naturally, the two client have a brand that they want to display on the website -- logo, color, etc. The actual application is
exactly the same for each; let's say they want a page that accepts a visitors first name that, when submitted, display a second
page that say "Hello, <firstname>! Would you like to buy a book?". Now, since the two applications are the same, I don't really
want to have multiple copies of the index.aspx and hello.aspx pages; rather have these shared between the two websites and only change
the 'brand' displayed. Yes, we can assume the two site are hosted on the same server in two different virtual directories.

While some of the branding can be done with .CSS and .SKIN files, I'm believing that the whole visual look of the site is too much
for just .CSS and .SKIN files along -- so it would seem that master pages are the best way to go -- one with JungleRiver.com's brand
and the other for SR.com's. For a week or so I played with 'dynamic master' pages (and got it working too!) before I realized that
I could just name the master page something common (like skin.master) in the virtual directory for each site.

Currently however, I copy the entire site over as well -- the master page along with all the content pages that perform the
same function. So, I have duplicate pages in JungleRiver.com and SR.com. The obvious problem being that if I need to change one
of the content pages, I need to change it in ALL the sites.

So, I figure that I can place the common content pages in a separate directory. At this point however, I'm thinking that master
pages work a little backwards -- such as when I enter a URL like www.jungleriver.com what I want is for IIS to use the
skin.master from inetpub/wwwroot/JungleRiver and the index.aspx from (say) inetpub/wwwroot/common. This begs two questions that I
haven't resolved in my cranium yet:
1. Who to get IIS to render the index.aspx content page from common
2. How does index.aspx know to use the master page from JungleRiver rather then ShedsAndRoyal? (Which I can do by setting
(from the JungleRiver/web.config file)

Any nudge forward, or in a different direction, would help.

In reality, the application is not so simple (I'm sure you figured that out). There are about 30 content pages and 50 or so clients
(read that as 1470 duplicated content pages). The process and page flow is defined in the web.config file.
__________________
Wolffy
------------------------
Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.
Reply With Quote
  #2  
Old August 13th, 2008, 03:08 PM
jmurrayhead's Avatar
The Barnfather


 
Join Date: Mar 2008
Location: Washington, D.C.
Posts: 1,566
Thanks: 39
Thanked 166 Times in 157 Posts
Blog Entries: 7
Rep Power: 10
jmurrayhead is a splendid one to beholdjmurrayhead is a splendid one to beholdjmurrayhead is a splendid one to beholdjmurrayhead is a splendid one to beholdjmurrayhead is a splendid one to beholdjmurrayhead is a splendid one to beholdjmurrayhead is a splendid one to behold
Default

It sounds like you need a setup like the following, using Virtual Directories:

Sharing Master Pages in Visual Studio

ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

Reply With Quote
  #3  
Old August 13th, 2008, 03:27 PM
Wolffy's Avatar
Slaprentice of Wolves

 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 392
Thanks: 7
Thanked 58 Times in 51 Posts
Blog Entries: 1
Rep Power: 4
Wolffy is a jewel in the roughWolffy is a jewel in the roughWolffy is a jewel in the rough
Default

Thanks, I'll take a deeper look at those mebbe tonight or over the weekend. Quick look tho seems to be doing what I call the 'backward' approach -- the content page controls the master page -- but I can see many nuggets of goodness in there.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Error Type:Active Server Pages, ASP 0113 (0x80004005) guddu ASP Development 20 July 11th, 2008 09:44 AM
Date Last Modified for ASP Pages mehere ASP Code Samples 0 March 21st, 2008 12:20 PM
Accessing skmmenu control in Master Page richyrich .Net Development 13 March 18th, 2008 11:45 AM


All times are GMT -4. The time now is 08:32 PM.


Copyright ©2008-2009, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.0