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

Join 136,836 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,576 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
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
+Quote Post

gabehabe
RE: Namespace Error With Master Page
3 Oct, 2008 - 06:07 AM
Post #2

Donkey DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 5,551



Thanked: 98 times
Dream Kudos: 2650
Expert In: ruling the world.

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
+Quote Post

KBS
RE: Namespace Error With Master Page
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
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 04:33PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month