Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,315 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,077 people online right now. Registration is fast and FREE... Join Now!




Namespace error with master page

 
Reply to this topicStart new topic

Namespace error with master page

KBS
post 3 Oct, 2008 - 05:53 AM
Post #1


New D.I.C Head

*
Joined: 3 Oct, 2008
Posts: 4

Hi!


I have a ASP.net 2.0 application that uses a masterpage. When I open a page that uses the masterpage it gives me the following error:

"The type or namespace name 'TemplateContainer' could not be found (are you missing a using
directive or an assembly reference?)"

I do not get this error with a page that does not use a master page.

I have used master pages before but never saw this kind of error before..

Thanks

User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 3 Oct, 2008 - 06:07 AM
Post #2


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


TemplateContainer isn't being declared in the scope of your master page. Is it in another namespace? Is it private?

If you could post your code, I might be able to figure it out smile.gif
User is offlineProfile CardPM

Go to the top of the page

KBS
post 3 Oct, 2008 - 06:31 AM
Post #3


New D.I.C Head

*
Joined: 3 Oct, 2008
Posts: 4

QUOTE(gabehabe @ 3 Oct, 2008 - 07:07 AM) *

TemplateContainer isn't being declared in the scope of your master page. Is it in another namespace? Is it private?

If you could post your code, I might be able to figure it out smile.gif


Thanks for your quick response.
Here is the code for the master page.cs file :

csharp

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.UI.MobileControls;
using System.Threading;
using System.Globalization;
using System.Drawing;
using System.Collections.Specialized;
using System.Data.SqlClient;
using System.Xml;


public partial class TestWebGlobal : System.Web.UI.MasterPage
{

protected void Page_Load(object sender, EventArgs e)
{

}
}


And teh code for the masterpage.aspx file:

CODE

<%@ Master  Language="C#" AutoEventWireup="true" CodeFile="TestWebGlobal.master.cs" Inherits="TestWebGlobal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    
</head>
<body>
    <div style="text-align: center; vertical-align:top">
<form id="TestWebGlobalMaster" runat ="server">      
      
       <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
     </form>
    </div>
</body>
</html>
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 02:23AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month