CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 2/7/2006 6:24:19 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 30 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
johnsh
Asp.Net User
How do you reference a master page outside of current application?2/7/2006 6:24:19 PM

0/0

All the samples for master pages I've seen reference master pages like this: ~/SiteTemplate.master

I'm not sure why anyone would actually utilize master pages in this fashion. Anyway, I have a website that consists of numerous ASP.NET applications (each referred to as a website in VS 2005) which I'd like to have share a master page. My directory structure on the website is like this:

/Apps/App1, /Apps/App2, /Apps/Common, /Apps/App3, ...

So the path to any one of these apps can be referred to as /Apps/App1/default.aspx and depending on if it's on our public site, dev site, test site, or intranet site the correct URL will be formed .. ie, http://myTestDomain.com/Apps/App1/default.aspx

I would like to locate my master page in the  /Apps/Common/MasterPages directory and was thinking I'd reference it like: MasterPageFile="/Apps/Common/MasterPages/MasterPage.master" but that doesn't work. I've tried using "../Common/MasterPages/MasterPage.master" and there's a problem with that. I'd like to get some help on understanding the correct way to reference the path to the master page file when it is outside the current application.

So, my Page directive for /Apps/App1/default.aspx looks like this but it doesn't work.

<%@ Page Language="C#" MasterPageFile="/Apps/Common/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

Thanks for any help ... john

ccampj
Asp.Net User
Re: How do you reference a master page outside of current application?2/7/2006 8:46:48 PM

0/0

I read an article about doing this... something about compiling your master templates and adding them to the GAC - way too much work for me...

What I did was:

  1. create my site master pages in wwwroot/sitemmasterpages and made sure I add it as a virtual directory.
  2. in the app where I want to use it, i add a virtual directory point to the site master pages directory
  3. i then create a local directory for the apps' master pages called masterpages.
  4. i create a local master page called AppMaster.master and assigned my site master to it (MasterPageFile="~/sitemasterpages/sitemaster.master")
  5. I also tell web.config to use my appmaster page for all pages:

    <pages masterPageFile="~/masterpages/AppMaster.master">

  6. This works pretty well, but VS complains a little about it, but no errors.

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit: visual web developer 2005 express edition starter kit Authors: David Sussman, Alex Homer, Pages: 312, Published: 2005
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Visual Studio 2008 All-In-One Desk Reference For Dummies Authors: Rick Leinecker, Vanessa L. Williams, Pages: 816, Published: 2008
ASP.NET 2.0 MVP Hacks and Tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006
Programming Microsoft Visual Basic 6.0: [master Object-oriented Programming Techniques for Rapid 32-bit Development] Authors: Francesco Balena, Pages: 1276, Published: 1999

Web:
How do you reference a master page outside of current application ... I'd like to get some help on understanding the correct way to reference the path to the master page file when it is outside the current application. ...
Visual Studio Magazine Online | Feature: Create Master Pages in ... You can also define a master page for a Web application inside the web.config file. ... master pages, or content pages that reference nested master pages. ...
Customizing Application Master Pages - part 5 of 6 | SharePoint ... Oct 31, 2008 ... So, as you can see, it is important to customize the application master page unless you remove all references to all application pages that ...
Piyush Shah's Blog : Sharing Master Pages amongst Applications by ... "Server Error in '/WebSite1' Application". "Content controls have to be top- level controls in a content Page or a nested master page that references a ...
ASP.NET Master Pages Overview If the directive references a master page, the master page is read as well. .... NET pages (.aspx files) in the application automatically bind to a master ...
Master Pages and Web Application Project problems « Grant Holliday HttpException: Content controls are allowed only in content page that references a master page. And since we’ve specified a blank Master Page at the page ...
CleverWorkarounds » SharePoint Branding - How CSS works with ... Some of the pages use another master page called APPLICATION.MASTER. All affected pages are references by the _layout entry in the URL. ...
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... What if we have 2 different master pages in the application? ..... Using the FindControl method on the Page reference means we won’t be ...
Visual Inheritance with Master Pages and the @Reference tag - Rick ... re: Visual Inheritance with Master Pages and the @Reference tag by Scott July 25 , 2006 @ 5:26 pm I'm trying something like this using Web Application ...
Tip and Tricks: ASP.NET 2.0 AJAX 1.0 Extensions and Master Pages ... Therefore, we conclude that, the ScriptManager located inside the MasterPage should include all references to JavaScript files inside your web application. ...

Videos:
A New Way to look at Networking Google Tech Talks August 30, 2006 Van Jacobson is a Research Fellow at PARC. Prior to that he was Chief Scientist and co-founder of Packet Design. P...
Charlie Rose - Judy Woodruff & Mike Allen / Wole Soyinka / Jeremy Allaire Segment 1: Guest host Judy Woodruff talks politics with Mike Allen of Time magazine. Segment 2: Nobel laureate Wole Soyinka talks with guest host ...
Kirby Air Ride another video
Elohim Over time, God has revealed Himself through many names, and through those names, we get to know Him on a much more personal level. The first is El...
Long Beach City Council Meeting Long Beach City Council Meeting
www.moldytoaster.com COURT AND CITY. The other evening, the public were put in possession, at Covent Garden Theatre, of a new branch of art in play concoction, which m...




Search This Site:










proper aproch for good web designing - need opinions

master page translation on different browsers.

performance of using nested master pages.

master page question

menu options visible to all after adding roles in sitemap

contentplaceholder alignment

want to create menu within menu dynamic..pls help with code

redirect atomz search result to a page based on a master page

dynamicaly adding nodes to sitemap

i'm having a helluva time registering a custom sitemap provider.

how shoul i transfer value to a contentplaceholder.

templated menuitem & postback

master page, menu and postback

load xmlsitemap from stream?

master page

disable asp:menu items

how to run see web site made on visual web developer 2005

javascript and treeview_togglenode

navigation ctrls in .net 2003 [is possible?]

path mapping problem to app_themes and master pages (due to the page starting in subdirectories?)

datagrid problem with master pages

write sitemap and write xml

using menu as site navigation

unable to access property from master page

masterpage/menu - content page getting cut off in firefox

treeview

masterpage

getting at xml in navigation control through c#

simple page_load question

flatten combobox

  Privacy | Contact Us
All Times Are GMT