Class of UserControl not found in Page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mathias Fritsch

    #1

    Class of UserControl not found in Page

    I am using FindControl in my page and try to cast the control found to
    a specific control.

    ((Controls_Foot er)this.Master. FindControl("Fo oter1")).OnPrin tToPdf +=
    new Controls_Footer .PrintToPdf(Foo ter1_OnPrintToP df);

    This works but after a while doesnt compile anymore in Visual Studio.

    "Type Controls_Footer not found" is the error.

    I can then change the web.config to compile in release and it compiles
    again - well most of the time.

    It compiles without problems on my buildserver which uses a
    webdeployment - project.

    What is wrong here?

    Mathias
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Class of UserControl not found in Page

    you a counting on compile batching (compiling pages into one dll) to resolve
    reference. you can select rebuild or as you shoudl have done in the forst
    place, add a reference to the in page

    -- bruce (sqlwork.com)


    "Mathias Fritsch" wrote:
    I am using FindControl in my page and try to cast the control found to
    a specific control.
    >
    ((Controls_Foot er)this.Master. FindControl("Fo oter1")).OnPrin tToPdf +=
    new Controls_Footer .PrintToPdf(Foo ter1_OnPrintToP df);
    >
    This works but after a while doesnt compile anymore in Visual Studio.
    >
    "Type Controls_Footer not found" is the error.
    >
    I can then change the web.config to compile in release and it compiles
    again - well most of the time.
    >
    It compiles without problems on my buildserver which uses a
    webdeployment - project.
    >
    What is wrong here?
    >
    Mathias
    >

    Comment

    • Mathias Fritsch

      #3
      Re: Class of UserControl not found in Page

      Thank you all: I added <%@ Reference Control="YourUs erControl.ascx"
      % and things are compiling now!

      Mathias

      Comment

      • Juan T. Llibre

        #4
        Re: Class of UserControl not found in Page

        Good news, Mathias !



        Juan T. Llibre, asp.net MVP
        asp.net faq : http://asp.net.do/faq/
        foros de asp.net, en espaƱol : http://asp.net.do/foros/
        =============== =============== ========
        "Mathias Fritsch" <mathiasfritsch @gmx.dewrote in message
        news:1f7401ca-c137-441c-a7be-871ddd957bf6@a7 0g2000hsh.googl egroups.com...
        Thank you all: I added <%@ Reference Control="YourUs erControl.ascx"
        % and things are compiling now!
        >
        Mathias

        Comment

        Working...