Global Master Page

Last post 11-04-2008 4:52 AM by binal_1982. 7 replies.

Sort Posts:

  • Crying [:'(] Global Master Page

    03-01-2006, 11:46 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    Hello,

    I am having some trouble, with using shared master pages accross multiple applications.

    The idea I found some info on, which kind of works, is that you create a clean web project, make some master pages, publish it so you get compiled masters, add the compiled master to gac, and then you can use this master in other projects. ( Although you have to create a dummy master in the new project, which inherits from the global master, really...this is dumb, we should not have to have phyical masters... i should be able to declare a master from an object in the page preinit where i would declare a master file, nevertheless ),..... so i have these dummy pages.. and to make the situation a little more interesting, i have 3 masters in the GAC, and 3 dummy mastes in the local project, all inheriting from their respective global master. The global masters all share one commone base master class. So.. to summarize, in one web project called (masters) there are 3 masters, and one partial class that is the base class. All three masters inherit from this partial class, and all three masters have the same elements, only different layouts.

    In the object browser of the local project now, i see al the masters, and have inherited from them with no problem. Whoever, now I am getting  aweird error, that I have no clue how to debug... or even being understanding what is causing it. ( Keep in mind, there are no string resource files, not a single resx in any of my projects ).

    Below I have attached the error, you will notice things like Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gbm2o\9232f8e6\59c33552\App_Web_3ctpvlsd.4.cs    Line: 0

    I am not sure why this is there, becuase i am running the site from http://localhost/GBM2o/Default.aspx and the site is not published, meaning it is using the local cs files so if i make a change, iht refresh, change is there....

     

    Here is the error

    Server Error in '/GBM2o' Application.

    An error occurred while try to load the string resources (FindResource failed with error -2147023083).

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: An error occurred while try to load the string resources (FindResource failed with error -2147023083).

    Source Error:

    [No relevant source lines]

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gbm2o\9232f8e6\59c33552\App_Web_3ctpvlsd.4.cs    Line: 0

    Stack Trace:

    [HttpException (0x80004005): An error occurred while try to load the string resources (FindResource failed with error -2147023083).]
       System.Web.StringResourceManager.ReadSafeStringResource(Type t) +3116601
       System.Web.UI.TemplateControl.ReadStringResource() +11
       ASP.rbsgc_master..ctor() +67
       ASP._rbsgc_master..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gbm2o\9232f8e6\59c33552\App_Web_3ctpvlsd.4.cs:0
       __ASP.FastObjectFactory_app_web_3ctpvlsd.Create_ASP__rbsgc_master() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gbm2o\9232f8e6\59c33552\App_Web_3ctpvlsd.6.cs:0
       System.Web.Compilation.BuildResultCompiledType.CreateInstance() +49
       System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +250
       System.Web.UI.Page.get_Master() +48
       System.Web.UI.Page.ApplyMasterPage() +18
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +543
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Global Master Page

    03-01-2006, 12:09 PM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    Apparently Dan wahlin has come accross this issue, and updated his blog entry with the solutio ( I didnt try it yet, but i am about to ), this is the same post where i originally ready about the the solution for sharing master pages.

    I tell you there are a few bloggers out there in the realm, hwo just consistantly put out high quality useful informatio.

    Thanks to the great .net developers world wide!.

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Global Master Page

    03-01-2006, 2:43 PM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    Removing whitespace did not help me.... so if anyone can help.... i really need it :-)

    This error is killing me, and it is a must for the project I am doing that multiple apps can share master pages.

    Really, this is a basic need I think in larger companies where you have a base site.

    and then you normally develop many small projects, that sit under that main app.

    There must be a way for the small apps to use the masters from the main root site.

    I refuse to believe that to do this I have to duplicate all my masters in each project.

    Anyone? Anyone?

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Global Master Page

    05-10-2006, 5:28 PM
    • Member
      10 point Member
    • tzuff
    • Member since 05-10-2006, 9:25 PM
    • Posts 2

    Hi Jonathan,

     

    I just went through the same steps and I am not able to get any further than you have with the string resources error.  I was wondering if you came up with another solution to share master pages over multiple IIS applications. 

     

    Thanks,

    tzuff

  • Re: Global Master Page

    05-10-2006, 5:46 PM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    he best solution i have involves "junction" points, and works very well. the only draw back is you need enough permission on the server to create them.

    i have a base master page in the junction folder.

    and the basemaster class is compiled inside a shared dll that is in my gac.

     

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Global Master Page

    04-10-2008, 4:30 PM
    • Member
      309 point Member
    • anu0987
    • Member since 02-09-2006, 1:17 PM
    • Providence, RI, USA
    • Posts 186

    Can you guide me about this Junction Point.

    I am trying to create Global master page. Trying to Implement this with Dan Wahlin's article http://weblogs.asp.net/dwahlin/archive/2005/11/16/430779.aspx

    but gettong the same error you mentioned.

     Thanks,

    Mark this as an answer if you find my it helpful.

    Thanks,
    Anubhuti
  • Re: Global Master Page

    10-31-2008, 11:39 AM
    • Member
      2 point Member
    • kamnel
    • Member since 10-31-2008, 3:25 PM
    • Posts 1

    I had a similar problem and was able to solve my problem using the approach of Dan wahlin.

    When you precompile our application, behind the scenes all the HTML is converted to Literal objects and the page object is created.  when the HTML is small enough then it is declared as string in the calss, if the HTML is big then it puts the HTML into a resource file and then reads it. Here lies the problem.

    when you put your precompiled assembly in another webapp, it does not know from where to pick up the resource file and throw error.

    To solve this problem you need to make your HTML strings small enough so that it is not stored in resource file. The approach I followed is to have runat="server" tags in the HTML at regular intervals so as to force the compiler to create a HTML object instead of treating it as a literal sting. Now precompile the app, and use reflector to see if there are any places where the compiler generates code "base.CreateResourceBasedLiteralControl". If there are no instances then your master page is ready to be deployed. If there are any instances of code "base.CreateResourceBasedLiteralControl" present then you need to identify the HTML block which is causing this and go back to master.aspx and make some more objects as runat="server"

    Hope this helps 

     

     

     

  • Re: Global Master Page

    11-04-2008, 4:52 AM
    • Member
      2 point Member
    • binal_1982
    • Member since 11-04-2008, 4:34 AM
    • Posts 1

    I am facing similar problem and yet could not resolve it.

    I have Solution file with 6 Class Libraries and one Website (User Control), which i want to reuse across applications. I have published the User Control Web Site using Fixed named assemblies and Updatedable= false. I get multiple dll's created.

    If I add above dll references to other WebSite adding reference as shown below, it works perfectly fine.                                                                             <%@ Register Assembly="App_Web_taskmanager.ascx.7fd89c35" Namespace="MyUserControl.Controls.Tasks" TagPrefix="Alerts" %>

    But if I merge all dll's, add reference and try to create object of the User Control Class, it gives the error "FindResource failed with error -2147023083".

    I have tried solution that you have given, but did not help.

    Any assistance would be of great help. 

     

Page 1 of 1 (8 items)