2 Replies - 2435 Views - Last Post: 03 October 2008 - 07:31 AM Rate Topic: -----

#1 KBS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 08

Namespace error with master page

Post icon  Posted 03 October 2008 - 06:53 AM

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

Is This A Good Question/Topic? 0
  • +

Replies To: Namespace error with master page

#2 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1383
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Re: Namespace error with master page

Posted 03 October 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 :)
Was This Post Helpful? 0
  • +
  • -

#3 KBS  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-October 08

Re: Namespace error with master page

Posted 03 October 2008 - 07:31 AM

View Postgabehabe, on 3 Oct, 2008 - 07:07 AM, said:

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 :)


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

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:

<%@ 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>


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1