+ Reply to Thread
Results 1 to 3 of 3

Thread: 'Dynamic' Master Pages

  1. #1
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    '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.

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  3. #3
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    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.
    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 to Thread

Similar Threads

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO