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
Namespace error with master page
Page 1 of 12 Replies - 2020 Views - Last Post: 03 October 2008 - 07:31 AM
Replies To: Namespace error with master page
#2
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
If you could post your code, I might be able to figure it out
#3
Re: Namespace error with master page
Posted 03 October 2008 - 07:31 AM
gabehabe, 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
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>
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote








|