Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Master Page from Project DLL

Avatar of hscast
hscast asked on
.NET ProgrammingC#
5 Comments1 Solution912 ViewsLast Modified:
Situation:
    Intranet setting.  End result will have about 12-14 separate projects for different departments, etc.  1 Project contains our login security classes, as well as a master page template for the look of the site.  This Master Page will be used for 98% of the site.

Now, the sunday drive version of doing this is to just copy the master page to every project, and hit the ground running.   However if a change ever needs to be done to the master page, we now are changing it in 12-14 projects.

So we tried outputting a dll of our main project that contains the master page, and then referencing that dll on the other projects.  This actually somewhat worked.  Except for the objects we have on the dll master page.  On that page we have simple linkbuttons for the navigation for our intranet.  When we test the dll project by itself, everything works fine.   But when we test the secondary project that pulls in the dll, the first object it comes to (in this case, a linkbutton), it gives an Object reference not set to an instance of an object error.

Easier explanation:  Project A contains security and Master Page Layout.  Project A is compiled into a dll.  Project B references dll.  Project B has a Master Page that Registers a TagPrefix from the DLL, and is attached onto the page, then Project B internal page references Project B's Master page.  I would be fine skipping Project B's master page if I could reference Project A's master page directly onto Project B's internal pages.

Any ideas?
Project B Master Page:

<%@ Register TagPrefix="cc1" Namespace="ProjA" Assembly="ProjA" %>

<body id="page1">
    <form id="form1" runat="server" style="height:100%">
    <cc1:SiteMaster ID="MasterForm" runat="server">
    
    </cc1:SiteMaster>
    <asp:ContentPlaceHolder ID="MainContent" runat="server">
        Test
    </asp:ContentPlaceHolder>    
</form>
</body>