CS0246: The type or namespace name 'TemplateContainer' could not be found

Discussion in 'ASP .Net' started by robseflops@gmail.com, Feb 6, 2006.

  1. Guest

    Hi!
    I have a Asp.net 2.0 application that uses a masterpage. It works fine
    on the development machine but when I move the app to a Win 2003 server
    thinks go wrong: When I navigate to a page that uses the masterpage I
    get the CS0246 error:

    Compiler Error Message: CS0246: The type or namespace name
    'TemplateContainer' could not be found (are you missing a using
    directive or an assembly reference?)

    Source Error:

    Line 117: }
    Line 118:
    Line 119: [TemplateContainer(typeof(System.Web.UI.MasterPage))]
    Line 120:
    [TemplateInstanceAttribute(System.Web.UI.TemplateInstance.Single)]
    Line 121: public virtual System.Web.UI.ITemplate
    Template_ContentPlaceHolder1 {


    Pages that don't use the masterpage work OK,
    any ideas?

    many thanks in advance
     
    , Feb 6, 2006
    #1
    1. Advertising

  2. RE: CS0246: The type or namespace name 'TemplateContainer' could not b

    Check the web.config file. In the <system.web><pages></pages></system.web>
    section, I had the following:

    <pages
    buffer="true"
    enableSessionState="true"
    enableViewState="true"
    enableViewStateMac="true"
    smartNavigation="false"
    autoEventWireup="true"
    pageBaseType="System.Web.UI.Page"
    userControlBaseType="System.Web.UI.UserControl"
    validateRequest="true"
    masterPageFile=""
    theme="CardinalHealthTheme"
    styleSheetTheme=""
    maxPageStateFieldLength="-1"
    compilationMode="Always"
    pageParserFilterType=""
    viewStateEncryptionMode="Auto"
    maintainScrollPositionOnPostBack="false"
    asyncTimeout="45">
    <namespaces>
    <clear />
    </namespaces>
    <tagMapping>
    <clear />
    </tagMapping>
    </pages>

    It caused the same error that you reported. If you notice, I cleared the
    namespaces and tagmappings. If you remove the <clear /> from the namespaces
    section, it will build again.

    --
    Senior .NET Consultant
    Enterprise Web Services
    Cardinal Solutions Group
    www.cardinalsolutions.com


    "" wrote:

    >
    > Hi!
    > I have a Asp.net 2.0 application that uses a masterpage. It works fine
    > on the development machine but when I move the app to a Win 2003 server
    > thinks go wrong: When I navigate to a page that uses the masterpage I
    > get the CS0246 error:
    >
    > Compiler Error Message: CS0246: The type or namespace name
    > 'TemplateContainer' could not be found (are you missing a using
    > directive or an assembly reference?)
    >
    > Source Error:
    >
    > Line 117: }
    > Line 118:
    > Line 119: [TemplateContainer(typeof(System.Web.UI.MasterPage))]
    > Line 120:
    > [TemplateInstanceAttribute(System.Web.UI.TemplateInstance.Single)]
    > Line 121: public virtual System.Web.UI.ITemplate
    > Template_ContentPlaceHolder1 {
    >
    >
    > Pages that don't use the masterpage work OK,
    > any ideas?
    >
    > many thanks in advance
    >
    >
     
    =?Utf-8?B?TWljaGFlbCBFIEJhbHRpYw==?=, Mar 16, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Benny Dein
    Replies:
    0
    Views:
    3,487
    Benny Dein
    Mar 20, 2006
  2. =?Utf-8?B?V2ViRGV2Mg==?=
    Replies:
    0
    Views:
    2,780
    =?Utf-8?B?V2ViRGV2Mg==?=
    Aug 24, 2006
  3. Replies:
    4
    Views:
    1,347
  4. SubZane

    CS0246: The type or namespace name...

    SubZane, Feb 8, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    383
    SubZane
    Feb 9, 2007
  5. ShailKumar
    Replies:
    1
    Views:
    1,641
    Brian Cryer
    Sep 13, 2011
Loading...

Share This Page